Re: Problem drawing directly to bitmap rep using NSGraphicsContext
Re: Problem drawing directly to bitmap rep using NSGraphicsContext
- Subject: Re: Problem drawing directly to bitmap rep using NSGraphicsContext
- From: Michael Watson <email@hidden>
- Date: Tue, 28 Nov 2006 12:09:48 -0500
Try this change:
[imageRep lockFocus];
[imageRep drawInRect:NSMakeRect(0, 0, [imageRep pixelsWide], [imageRep
pixelsHifh])];
[imageRep unlockFocus];
--
mikey
On 28 Nov, 2006, at 09:06, Vinay Prabhu wrote:
Hi,
In my application I am trying to directly draw into the bitmap rep.
The problem is only a fraction of the original image is drawn to the
NSBitmapRep.
Here is the code,
[NSGraphicsContext saveGraphicsState]
[NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithBitmapImageRep:pBitmapRep]];
NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithData:
[NSData
dataWithContentsOfFile:path]];
[imageRep drawInRect:NSMakeRect(0, 0, [imageRep pixelsWide], [imageRep
pixelsHifh])];
[NSGraphicsContext restoreGraphicsState];
What is wrong in this code?
Regards
Vinay
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40bungie.org
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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