• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGContext Drawn Squished
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGContext Drawn Squished


  • Subject: CGContext Drawn Squished
  • From: "Bridger Maxwell" <email@hidden>
  • Date: Fri, 14 Mar 2008 02:32:58 -0600

Hey,
  New to Quartz drawing, and am still hazy on some of the concepts
involved. I use:

_cgContext = CGBitmapContextCreate(NULL, frame.size.width,
frame.size.height, 8, 6 * frame.size.width, colorSpace,
kCGImageAlphaPremultipliedFirst);

To make a context to draw to. I do some drawing stuff. Later, I tag
the view as needing an update, and use this code to do the drawing:

- (void) drawRect:(CGRect)clip
{
	CGRect				bounds = [self bounds];
	CGContextRef	        	context = UIGraphicsGetCurrentContext();
	CGImageRef			image;

	//Copy the contents of the painting context to the view's context
	image = CGBitmapContextCreateImage(_cgContext);
	CGContextClearRect(context, self.frame);
	CGContextDrawImage(context, bounds, image);
	CGImageRelease(image);
}

After it is drawn though, the image comes out as being "squished"
vertically. So the x coordinates come out correctly, but the y
coordinates are smaller by a scale. I hope that makes sense. In other
words, something that should have been drawn in the bottom left corner
is still to the left left, but it is up from the bottom. It is like
the resolution of the two contexts is out of whack. Can someone give
me a hand here? What is going on?

 Thank You,
   Bridger Maxwell
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CGContext Drawn Squished
      • From: "Bridger Maxwell" <email@hidden>
  • Prev by Date: Re: Can core data save to a remote file?
  • Next by Date: Order of resulting selector invocations from performSelector
  • Previous by thread: A Request Regarding Subject Lines
  • Next by thread: Re: CGContext Drawn Squished
  • Index(es):
    • Date
    • Thread