Hiya,
I'm trying to draw a shadow and a corner radius on an image. I can add them separately, but I've got no way to add both effects at the same time. I'm adding a shadow with:
[layer setShadowOffset:CGSizeMake(0, 3)];
[layer setShadowOpacity:0.4];
[layer setShadowRadius:3.0f];
[layer setShouldRasterize:YES];
Here, layer is a CALaye...
Same problem as this guy
I'm trying to use CGBitmapContextCreateImage() or UIGraphicsGetImageFromCurrentContext(), but they leak badly, even if I don't do anything in the context. When I run this in a UIView subclass, before setNeedsDisplay:
UIGraphicsBeginImageContext(CGSizeMake(320, 264));
// Optional drawing code here, but still lea...
Hello all,
I need help for, scribbling on the webpage i.e where ever the user moves on the uiwebview there it should draw a line according to the touch moves.
Is this possible.
Can any one please help me in this.
Thanks,
Mrudula.
...
In the code below, CTFramesetterSuggestFrameSizeWithConstraints sometimes returns a CGSize with a height that is not big enough to contain all the text that is being passed into it. I did look at this answer. But in my case the width of the text box needs to be constant. Is there any other/better way to figure out the correct height for ...
Hi!
I'm generating an image using quartz 2d and I want to use it as an opengl texture.
The tricky part is that I want to use as few bits per pixel as possible, so I'm creating cgContext as following:
int bitsPerComponent = 5;
int bytesPerPixel = 2;
int width = 1024;
int height = 1024;
void* imageData = malloc(width * height * bytesPerP...
I am using CGPDF* set of classes to read a pdf document, is there a way to extract the object that was touched ('clicked') by user? In other way is there a way to get a PDF / (Quartz?) object at certain coordinates?
...
Hi i have a lot of image reading in my app and when I load the files i use
CGImageGetWidth and CGImageGetHeight to get the sizes of the images.
However this does not seem to return the right values all the time.
For example if I have an image whose size is 114x14, these functions will return 126x22 or something random like that.
The r...
The following is a snippet of code where I am trying to draw a circle but my x value prints as a constant value. It's most likely something very very simple. Thanks in advance for any help.
int sides = 100;
int radius = 200;
int centerX = 100;
int centerY = 100;
CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f};
CGContextSetStrokeColor(context,...
Hi folks, let me first off noting that I have absolutely no idea what I'm doing with objective-c and mac development (though I'm fine with c). I made a wonderfully simple graphics utility on leopard with the Quartz-2d binding for python:
http://developer.apple.com/graphicsimaging/pythonandquartz.html
that basically inputs a text file ...
Hi,
I'm trying to make resizable UIViews of which users can resize (code is done for that) and drag it around. Now I need to make it look like what it looks like in IB, with circles at its corners to drag, and dotted lines as borders of the UIView.
How do you think I should go about doing this?
Many thanks.
...
I'm trying to get my head around using QuartzCore to render semi-complex text/gradient/image UITableViewCell composites. Thankfully, Opacity will let me visually build the view and then spit out source code to drop in to cocoa touch. Trouble is, Opacity assumes the code is running on iOS 4, which is a problem if you want to draw Quartz...
I'm creating an image offscreen using a context from CGBitmapContextCreate().
While drawing text, I tried to use the:
CGContextSetTextMatrix(contextRef, CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, 0.0));
but my text was still upside down. If I used the standard transforms it was correct:
CGContextTranslateCTM(contextRef, 0.0, co...
I'm getting a strange CoreGraphics error from the following code:
NSView *docView = [[[webView mainFrame] frameView] documentView];
NSSize s = [docView bounds].size;
[[docView window] display];
[[docView window] setContentSize:s]; // Commenting this line removes the errors.
Here are the errors:
a.out[20033] : unknown error code: inva...
Can someone provide an example of drawing an iPhone-like turning wheel using Core Graphics. I know it can be done by drawing a sequence of lines but that requires a math formula to work out line points. Can someone help me with that?
Here is how it should look like:
It looks like it is made up of several lines with rounded edges and ...
I'm searching for some great Quartz 2D drawing tutorials aimed at the iPhone. I'm new to Quartz and want to start off with something easy and then progress to more difficult stuff.
Does anyone know of any Quartz 2D drawing tutorials that they would recommend?
...
I'm animating a pendulum which swings from 0 degrees to max 200 degrees and then back again. The problem is that if the pendulum goes over 180 degrees, it returns to 0 by the shortest route which is to continue clockwise. And I'd like it to go anticlockwise. Here's my code:
('right' is a boolean which is TRUE when the pendulum is swingin...
I've been messing around with IDA Pro and trying to disassemble my own products just for the sake of it.
I've noticed a couple of things I don't understand because my assembly language knowledge is terrible. Here is a little chunk of code which invokes CGContextSetRGBStrokeColor.
CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1);
In IDA i...
I have a little sketch program that I've managed to throw together using Quartz2D, but I'm very new to the iOS platform and I'm having trouble figuring out how to allow the user to save their sketch. I have a CGContextRef that contains the sketch, how can I save it so that it can later be retrieved? Once it's saved, how can I retrieve ...
I have a UIView subclass. This subclass has multiple subviews. Is it possible to draw a line using core graphics inside a subview that is part of the uiview subclass?
For example, I have a SampleView class, which is a subclass of UIView. Inside this class's header file is the property for UIView *sampleSubView, which is a subview of Sam...
I am endeavouring to rotate the imageView property of a UIBUtton without scaling it. The image in question is 24x18 - wider than it is tall - but once rotated into place the image is being scaled to keep those dimension - leaving me with a very squished image. How can I prevent this?
Below is my code ..
-(IBAction)rotateButton
{
NSLog...