I think the title is pretty descriptive:
I perform all 3 of these operations on a view, the result is 20 pixels of white space along the left side of the screen (if holding the iPhone is landscapeLeft).
I tried to fix it by performing a CGAffineTransFormTranslate(transform, -20, 0)
That just "slides" the view underneath the whitespace...
Whats the difference between the two?
I'm sure they have pros and cons, and situations they are better performers in.
Any resources that compare the two?
Is one better for animation (I imagine the CATransform3D)? Why?
Also I think I read somewhere that text clarity can be an issue, is one better at scaling text?
...
I've been bashing my face into this one for literally days now, and even though I feel constantly that I am right on the edge of revelation, I simply cannot achieve my goal.
I thought, ahead of time in the conceptual phases of my design, that it would be a trivial matter to grab a image from the iPhone's camera or library, scale it down...
Hi,
I'm trying to work out how to draw from a TexturePage using CoreGraphics.
Given a texture page (CGImageRef) which contains multiple 64x64 packed textures, how do I render sub areas from that page onto the device context.
CGContextDrawImage seems to only take a destination rect. I noticed CGImageCreateWithImageInRect, however this ...
On my iPhone app I have a UIImage instance. I want to get a derived a UIImage that is the result of the first UIImage where one of its colors (e.g. magenta) is made transparent. How can I do this?
...
In my application i can draw a line in a UIImageView by the code below,and i want redraw the line even longer when i call the function,however,the output come out is not as expected,it will just draw a new line and remove the old one,the length is remain the same jus the y position different,i dont know which line of my code is wrong or ...
I'm drawing offscreen to a CGContext created using CGBitmapContextCreate, then later generating a CGImage from it with CGBitmapContextCreateImage and drawing that onto my view in drawRect (I'm also drawing some other stuff on top of that - this is an exercise in isolating different levels of variability and complexity).
This all works f...
I'm writing a Carbon application and we are creating JPEG files. I'm currently doing this by using Quartz CGImageDestinations and kCGImagePropertyJFIFDictionary. However, JFIF doesn't seem to have any entry for compression quality. Does anyone know how to set this?
thanks
...
I'm trying to draw a pill type ellipse, as in Apple's Mail application which displays the number of emails in the inbox. Any idea why the following isn't drawing?
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat minX = CGRectGetMinX(rect);
CGFloat minY = CGRectGetMinY(rect);
CGFloat ...
I am attempting to implement a custom view. This view should display an image surrounded by a gray, rounded rect border. I can get the image to display fine, as well as the border, however, since the border has rounded corners, I need a way to clear those corners such that they correctly display whatever is behind the view. How can I acc...
hi,everybody:
i have a gdi engine that result in the standard bmp bits stream ,and now i wanna to display it by the CG in iphone , i use it like this:
// size -> image size
// rect -> current view rect
// pBits -> the BITMAPINFO image bits stream
long imgSizePerRow = ((long)(24 * size.width + 31) / 32) * 4;
CGDataProviderRef provid...
I have a CGContext that I create with CreateARGBBitmapContext from here. When I do CGBitmapContextGetBitsPerComponent it tells me 8 bits per component (Which is correct) However, when I do CGBitmapContextGetBitmapInfo or CGBitmapContextGetData, I get NULL. Those are only supposed to give NULL when the context isn't a bitmap context. How...
I'm working in Quartz/Core-graphics. I'm trying to create a black and white, 1b per pixel graphics context.
I currently have a CGImageRef with a grayscale image (which is really black and white). I want to draw it into a black and white BitmapContext so I can get the bitmap out and compress it with CCITT-group 4. (For some reason Quart...
I have a CGImage (core graphics, C/C++). It's grayscale. Well, originally it was B/W, but the CGImage may be RGB. That shouldn't matter. I want to create a CCITT-Group 4 TIFF.
I can create an LZW TIFF (grayscale or color) via creating a destination with the correct dictionary and adding the image in. No problem.
However, there doesn't...
My problem is this: I have a simple block image that I want to make a grid out of. I have created an array of CGPoints in my UIView. Then I used
blackImage = [UIImage imageNamed:@"black.png"];
and then
- (void)drawRect:(CGRect)rect {
for (int j = 0 ; j <= 11; j++)
{
for (int i = 0 ; i <= 7; i++)
{
[blac...
Actually that should work, but it doesnt:
CALayer *myLayer = [myUIImageView layer];
CGRect visRect = [myLayer visibleRect];
I get an "invalid initializer" error, although my view is loaded definitely since in the next few lines I obtain the frame from the view and move the view around. But under no circumstances I can obtain that visi...
They say, that there is a Stack that saves graphic states. Well, I am not sure what they mean by that term. Does the CGContextSaveGState save the current drawing I made, or does it save the drawing settings I currently have, like color, line width, font size, etc.?
...
CGFloat* colors = CGColorGetComponents(hsbaColor.CGColor);
Does this return a float, or an array of floats? It looks like the asterisk is shorthand for creating an array. Is that correct?
When I call this function on the CGColor property of an HSB UIColor object does it convert the values to RGB?
...
I'm trying to draw a shadow under the bottom edge of a UIView in Cocoa Touch. I understand that I should use CGContextSetShadow() to draw the shadow, but the Quartz 2D programming guide is a little vague:
Save the graphics state.
Call the function CGContextSetShadow, passing the appropriate values.
Perform all the drawing to which you ...
I would like to create an effect than an image zooms up from a thumbnail size to full screen.
I am not sure what's the right steps to achieve this. Should I create a transparent full screen window and animate a layer on top of it?
...