• 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
Re: Problem drawing directly to bitmap rep using NSGraphicsContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Re: Problem drawing directly to bitmap rep using NSGraphicsContext
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Problem drawing directly to bitmap rep using NSGraphicsContext (From: Vinay Prabhu <email@hidden>)

  • Prev by Date: Re: How to create a side drawer of fixed height
  • Next by Date: QTMovie setAttribute
  • Previous by thread: Problem drawing directly to bitmap rep using NSGraphicsContext
  • Next by thread: Re: Re: Problem drawing directly to bitmap rep using NSGraphicsContext
  • Index(es):
    • Date
    • Thread