• 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: Any way to draw a PixMapHandle into an NSView??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to draw a PixMapHandle into an NSView??


  • Subject: Re: Any way to draw a PixMapHandle into an NSView??
  • From: Jeff LaMarche <email@hidden>
  • Date: Tue, 4 Jun 2002 22:59:24 -0700

On Tuesday, June 4, 2002, at 06:54 PM, Roger O'Brien wrote:

> Hi there. Does anybody know by any chance if it is possible to draw a PixMapHandle
> into an NSView? Thanks in advance...
> _______________________________________________

Okay, you'll have to forgive me, it's been a while since I worked with Classic
/ Carbon, but if my memory serves, you should just be able to do something
like:

Assuming that 'pic' is a PixMapHandle;

NSImage *myImage = [[NSImage alloc] initWithData:[NSData dataWithBytes:
*pic length:GetHandleSize((Handle)pic)]];

You could then use any of a number of mechanisms for getting this image into
your view, either subclassing NSView or by simply using an NSImageView.


I don't remember the relationship between PixMapHandles and PicHandles. I
seem to recall that Pictures are a partially opaque data structure and that
PixMapHandles were simply the pixel data contained in a PicHandle. Since NSImage
'knows' the PICT format, I think initWithData would work with either a PicHandle
or a PixMapHandle. I know it works with a PicHandle because the code above
is actual working code (well, it got edited a tiny bit) from one of my programs,
but pic is a PicHandle, not a PixMapHandle in my program.

Hope this helps.
- Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Any way to draw a PixMapHandle into an NSView??
      • From: nicolas berloquin <email@hidden>
References: 
 >Any way to draw a PixMapHandle into an NSView?? (From: "Roger O'Brien" <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: drawing NOW in a callback, boom!
  • Previous by thread: Any way to draw a PixMapHandle into an NSView??
  • Next by thread: Re: Any way to draw a PixMapHandle into an NSView??
  • Index(es):
    • Date
    • Thread