Questions tagged [cgcontextref]
90 questions
0
votes
3 answers
Separating multiple UILabels with a line IOS
I wan to design a settings page, in which I have to draw lines between multiple labels, what is the best way to do this, I have googled around, got to know about CGContextRef approach. Is this the proper way, I need to have a line between labels…

Newbee
- 3,231
- 7
- 42
- 74
0
votes
1 answer
Memory leak in CoreGraphics while switching sprite texture. Code inside
EDIT: I tried using the push/pop thing, but now it crashes.
I have a feeling what I'm attempting to do is way off.. Is there any way to just get core graphics showing up on the screen? I need something thats able to be updated every frame, like…

PeteBob
- 55
- 1
- 5
0
votes
1 answer
Vertical and Horizontal view
I need your counsel about a problem I have. It´s about my iPhone simulator. When I run the program, it´s fine and perfectly okay on the vertical view.
However, on the horizontal view the buttons move to another position. "CGContextDrawPath" This…

Neru-J
- 1,623
- 2
- 23
- 38
0
votes
1 answer
CGContextRef rotation not working
I wanted to rotate the contents of the CGContextRef with -90 degrees.
I found some code but it is not working correctly.
CGContextRef tempColorRef = CGBitmapContextCreate(NULL, width, height, bitsPerComponent,
…

Jun
- 3,422
- 3
- 28
- 58
0
votes
1 answer
Working with UIGraphicsPushContext(aContext) and UIGraphicsPopContext()
I'm having problems getting the subject calls to work. The below test should draw two orange and one green rectangle.
Here is my understanding of the below code...
I draw a orange rectangle at 50,50
I call the draw greenRect at 200,200, sending…

suhrmesa
- 11
- 4
0
votes
1 answer
CTRunDraw() does implement correct behaviour
I am implementing a custom text layout algorithm on MAC OS X using CoreText. I have to partially render a portion of CTRun in different locations inside a custom NSView subclass object.
Here is my implementation of drawRect: method
-…

Khurram Shehzad
- 1
- 1
- 2
0
votes
2 answers
Iphone Pixel RGBA value editing
My goal is as follows.
When The player touches the screen the program should find out the values of the pixel at that location of touch and then loop through every pixel and any that are of the exact same RGBA values will be edited, at the moment i…

Genhain
- 1,937
- 1
- 19
- 38
0
votes
1 answer
Calling draw method external to the ViewController
I'm trying to setup a method in an external class that looks like the following:
myClass.m
- (void)drawSomeStuffInContext:(CGContextRef)context atStartingPoint:(CGPoint *)coords
{
//draw some stuff (ignoring coords for now)
…

Jesse
- 2,043
- 9
- 28
- 45
0
votes
2 answers
How to store CGContext state in a NSMutableArray?
I am new to the CGContext world.
I need to create a stack of CGContext(s) in a NSMutableArray.
I have a valid PDFContext created with UIGraphicsBeginPDFContextToData
I'm passing this context to a method as an argument
-(void) drawTo:(CGContextRef)…

EarlGrey
- 2,514
- 4
- 34
- 63
0
votes
2 answers
UIGraphicsBeginImageContext wasteful?
Is it not wasteful that there is a requirement that if you want to draw into a UIImage, that it always has to be into a new UIImage created with UIGraphicsBeginImageContext?
If frequent drawing needs to happen, why not let us draw into a preexisting…
user1312991
0
votes
1 answer
How to remove dots from lines while drawing paint brush in iphone?
I am using following code to create the paint brush in iphone.
@interface Canvas : UIImageView {
CGPoint location;
}
@property CGPoint location;
.m file
@synthesize location;
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
…

iosdev1111
- 1,048
- 1
- 13
- 32
0
votes
2 answers
iOS: CGContextRef drawRect does not agree with input
Background : I would like to draw blocks when the user touch up somewhere. If the block is there, I want to erase it. I manage the blocks by using NSMutableArrayto keep track of points where the block should go. Every time user touches, it will…

Byte
- 2,920
- 3
- 33
- 55
-1
votes
1 answer
Having trouble with graphics context
I am working on multiple terminal screen app, for that I have a custom UIView subclass for the terminal views. Every time I need a new terminal screen, I prepare a new view.
This view class draws the text using a CGContextRef. The problem I am…

Revinder
- 291
- 2
- 14
-1
votes
1 answer
iOS - Invalid context on CGContextRotateCTM
When I try to run my rotate method I get the following error:
: CGContextRotateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall…

Nikolaj Simonsen
- 1,650
- 3
- 18
- 34
-2
votes
1 answer
Need clarifications working with Views in iOS
Ok, I'm learning programming for iOS with Stanford's online course on iTunes U (CS193P) but I can't exactly get a hold on how all the stuff from UIView works.
Could someone explain how the following things work cohesively and how I should use…

James Traimory
- 513
- 1
- 4
- 8