I'm about at my wit's end over this issue, due to hitting a good dozen other website (as well as this one) looking for a straight-forward answer to my problem...
First off, I'm trying to figure out a way, given a starting image created via [UIImage imageNamed:] to add decorations based on processing over time. (Think of a heat map.) I...
Hi,
I am using CGAffineTransformMakeRotation to roatate my image that is palced in UIImageView. But I have noticed that when i move the image it makes the image border look blur and distorted.
Below is my code for the same
UIImageView1.image = [UIImage imageNamed:@"sample.png"];
albmImageView1.transform = CGAffineTransformMakeRotati...
I'm having trouble getting components added through the Interface Builder to work on the iPhone. It works perfectly in the simulator, but not on the device. When debugging I found that the events are handled on exit, instead of when i actually press the button. Anyone else run into this issue?
edit: after some investigation, it turns ou...
i'm having issues where if I use draw commands in a UIView::drawRect method, components created through Interface Builder will not resolve their events. Is there a way to force events to resolve, kind of like how you can force a draw by calling [self setneedsdisplay].
yes, i'm having problems clicking on buttons and switches. the events...
I am working on making a simple drawing program. So far I am able to stroke the path with a given color and that all works out fine. I was wondering if there was a way to stroke it with a texture instead of a color. Say for instance I want to give the path the look of a pencil line. Any idea on how I would go about doing that?
Thanks in...
The following code converts a PDF page into a JPEG. It runs as expected on Snow Leopard:
...
//get the image from the bitmap context
CGImageRef image = CGBitmapContextCreateImage(outContext);
//create the output destination
CGImageDestinationRef outfile = CGImageDestinationCreateWithURL(fileUrl, kUTTypeJPEG, 1, NULL);
//add the image ...
Hi!
I have a class which work is to parse a text into several pages.
I use sizeWithFont: method to identify when one page ends and another starts.
But unfortunately since the amount of text which needs to be parsed is pretty big, whole operation needs to be performed on a background thread (takes several second to complete). And therefo...
I want to stroke a path using a .png that I have but I just don't know hot to make a CGPatternRef.
...
I want to be able to draw using this as my stroke. How would I do this as efficient as possible, and on the fly drawing, I was thinking CGPatternRef, but I really don't know how to do that.
Edit:
It does not need to warp to the path. I just coultn't fix that issue in Illustrator.
...
I'm calling the following code from drawRect
- (void) drawPartial:(UIImage *)img colour:(UIColor *)colour {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextDrawImage(c...
I know that OpenGL has functionality that allow fog drawing.
But, how to draw fog (smoke) using Core Graphics? Is this hard task? And, what concepts for implementing this task?
...
I asked this question earlier and am now trying to explore the idea of making an offscreen image.
Something is going wrong - I think maybe with colour space? I've boiled the code down and down and down, until I eventually can demonstrate the problem with just a few lines.
I have a view with an imageview (called iv) and a button, which...
Hi all,
I am trying to add a curved border around an image downloaded and to be displayed in a UITableViewCell.
In the large view (ie one image on the screen) I have the following:
productImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:product.image]];
[productImageView setAlpha:0.4];
productImageView.frame = CG...
hi,
I am developing an iPhone app that resizes and merges images.
I want to select two photos of size 1600x1200 from photo library and then merge both into a single image and save that new image back to the photo library.
However, I can't get the right size for the merged image.
I take two image views of frame 320x480 and set the v...
UPDATE:
I tried implementing the method specified by Peter and am getting incorrect shadowing. What is wrong?
CGContextSetShadowWithColor(c, CGSizeMake(4, 4), kAudioThumbShadowBlur, [[UAColor blackColor] CGColor]);
CGContextFillPath(c);
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, minx, mid...
Hi all.
I want to draw some curve in my scroll view using CGPathRef. I tried to draw this path but i see only the part of my CGPathRef which located at 320x480 pixels. Is it way to do that.
Thank you in advance.
Here is my code
path = CGPathCreateMutable();
CGContextBeginPath(ctx);
CGContextMoveToPoint(ctx, [[pathArray objectAtInd...
Something must be wrong with this code right here:
+ (UIImage*)captureView:(UIView *)theView {
UIGraphicsBeginImageContext(theView.frame.size);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
...
Pretty simple question: when doing some pretty intense drawing with CoreGraphics on the iPhone, how can I specify the pixel format to get optimal performance? Is the format that I get from the context via UIGraphicsGetCurrentContext per definition the best one? I know that RGB565 is supposed to be the fastest to use in OpenGL. Does that ...
I need to do something similar, where an animation highlights the text of a button to show that it must be slided to do something. Just like that unlock thing on the iPhone. How is that done? Is there a tutorial how to achieve this effect?
...
A simple google search for:
CGRect + C
or
CGRect in C
brings back only Apple, iPhone, and Objective-C websites. However, I remember hearing that Core Graphics was part of C at my university. Did I hear incorrectly, or is CGRect something that I can use in C, or even C++ as it's Object oriented?
...