drawrect Questions

8

Solved

I am looking for some up to date help/hints on how to draw simple single line strings around the edge of a circle using Swift2 for iOS9. I see quite dated examples involving old ObjC fragments, and...
Goethe asked 24/9, 2015 at 22:19

5

Solved

I searched everywhere but didn't find the solution. I have image 1. How can I programatically tint them with gradient to get images 2 and 3? Here are those images: Tints that I applied to them v...
Rhyner asked 11/11, 2011 at 18:8

9

Solved

With the code below, I am successfully masking part of my drawing, but it's the inverse of what I want masked. This masks the inner portion of the drawing, where I would like to mask the outer port...
Cryptozoic asked 19/1, 2013 at 6:23

6

Solved

Given an UIImage and a CGRect, what is the most efficient way (in memory and time) to draw the part of the image corresponding to the CGRect (without scaling)? For reference, this is how I current...
Graphophone asked 7/11, 2011 at 11:14

4

Solved

I am looking to draw a UILabel (preferable through subclassing) as a transparent label, but with solid background. I draw up an quick example (sorry, it's ugly, but it gets the points across :)). ...
Rusel asked 4/1, 2012 at 1:38

6

Solved

I'm looking for a way to animate the drawing of a circle. I have been able to create the circle, but it draws it all together. Here is my CircleView class: import UIKit class CircleView: UIView...
Javanese asked 26/10, 2014 at 21:13

2

I am creating a rectangle in @Override method of ReplacementSpan. How to add RoundCorner and padding to it? Code: @Override public void draw(Canvas canvas, CharSequence text, int start, int end, ...
Ally asked 24/10, 2015 at 9:21

4

Solved

I'm 3 days new to swift, and I'm trying to figure out how to draw a rectangle. I'm too new to the language to know the classes to extend and the methods to override, and I've looked around for samp...
Corelative asked 26/6, 2016 at 20:35

2

Solved

The code below nicely creates a rounded rectangle that is defined by a CGRect (rectRect). It fills fine, but I am not getting a stroke. Any ideas why I can't see the stroke? -(void)drawRect:(CGR...
Joyejoyful asked 23/11, 2012 at 9:23

2

Solved

Using Swift, I want to get the boundingRect of a glyph, in draw#rect in a UILabel. The UILabel already has a size (say 300x300 in the example) and qualities such as the text being centered. class...
Eyebrow asked 8/7, 2019 at 13:23

16

Solved

I have to create a custom UIView that will have round corners, a border, a shadow and its drawRect() method is overridden to provide custom drawing code with which several straight lines are drawn ...
Giro asked 31/8, 2014 at 11:10

4

Solved

I want to draw a filled rectangle in my viewContoller's view. I wrote the code below in viewDidLoad. But there is no change. What is wrong? CGRect rectangle = CGRectMake(0, 100, 320, 100); CGConte...
Cotangent asked 19/11, 2011 at 15:42

2

Since we are talking about programmatically, Instruments are not under my consideration. Some reference listed in advance: Calculate fps (frames per second) for iphone app Display FPS on iOS ons...
Woodbury asked 12/11, 2014 at 13:43

2

Solved

Can I draw shapes like circle, rectangle, line etc outside drawRect method using CGContextRef contextRef = UIGraphicsGetCurrentContext(); or is it mandatory to use it inside drawRect only. Pleas...
Yuu asked 29/5, 2013 at 11:50

5

Solved

How to Call drawRect programmatically in objective c ? I want to call drawrect method of a view in my UItabbarcontroller. How i can do this ? Thanks in advance.. Edit I have to call when the vi...
Gentlewoman asked 4/5, 2010 at 10:33

2

I have the following code to show marker in a UIView. The marker show's well, and once we try to pinch zoom and scale the UIView using the transform the first drawing remains as it is, even after c...
Dong asked 18/8, 2014 at 9:40

4

Solved

How would one crosshatch (apply a set of parallel lines at 45 degrees) across the fill of a shape in IOS using core graphics? Sample code? (I'm specially interested in use with an MKPolygon in MK...
Zeeba asked 15/6, 2016 at 2:25

2

Solved

I'm trying to fade one UIColor to another in a drawRect. I've created this function to calculate a color at a certain percentage: - (UIColor *)colorFromColor:(UIColor *)fromColor toColor:(UIColor ...
Religious asked 2/4, 2013 at 6:49

1

Solved

I am creating a rectangular drawing program.The square is drawn only if the program is dragging to the bottom side. Even if dragging in the other direction, I want to ensure that squares are drawn ...
Cytoplasm asked 3/12, 2016 at 7:43

2

Solved

I am subclassing my UIView class. The Xcode (I am using 4.6.3) auto generated code says, /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects p...
Kaiser asked 11/9, 2013 at 18:8

5

Solved

Not a graphics programmer here, so I'm trying to stumble through this. I'm trying to draw 9 filled circles, each a different color, each with a white border. The UIView's frame is CGRectMake (0,0,6...
Dogvane asked 11/6, 2013 at 6:45

2

Solved

I am working on a circular progress bar for custom game center achievements view and I have kind of "hit the wall". I am struggling with this for over two hours and still cannot get it to work. Th...
Jigsaw asked 11/5, 2013 at 14:54

3

Solved

I'm writing an app building elements consisting of CGPoints. I have 2 buttons: makeRectangle and makeTriangle. For building/drawing stage I use three methods for rectangle and three methods for tri...
Niedersachsen asked 4/10, 2016 at 14:47

3

I am trying to create a family tree like structure in android. I am using canvas to draw rectangle and line for family members names and connecting line. I am drawing rectangle and line by the fol...
Bergama asked 11/9, 2016 at 10:55

4

I am trying to override the drawRect: method of UIView in my custom view. However, my view has a border radius defined as: sub = [[[NSBundle mainBundle] loadNibNamed:@"ProfileView" owner:self opt...
Achene asked 6/12, 2012 at 15:21

© 2022 - 2024 — McMap. All rights reserved.