Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get a picture from a resource file and draw it

0 views
Skip to first unread message

Hans Stoessel

unread,
Jan 22, 2007, 10:21:58 AM1/22/07
to
Hi

Until now, I used the command GetPicture, DrawPicture and KillPicture to get
a picture from a resource file and draw it into a window (dialog). Now
(since 10.4) are this command deprecated.

What command can I use to do the same with the new API?
Any code samples available?

Thanks a lot.

Greetz
Hans


Gregory Weston

unread,
Jan 22, 2007, 3:07:00 PM1/22/07
to
In article <51k34tF...@mid.individual.net>,
"Hans Stoessel" <hstoess...@pm-medici.ch> wrote:

> Hi
>
> Until now, I used the command GetPicture, DrawPicture and KillPicture to get
> a picture from a resource file and draw it into a window (dialog). Now
> (since 10.4) are this command deprecated.
>
> What command can I use to do the same with the new API?

Erm. _Which_ new API? I think the current recommended mechanism for
procedural code uses QuickTime and discrete image files. Without error
checking...

GraphicsImportComponent gi;
Rect r;
GetGraphicsImporterForFile(&myFSSpec,&gi);
GraphicsImportGetNaturalBounds(gi, &r);
GraphicsImportSetQuality(gi,1024);
GraphicsImportSetBoundsRect(gi,&r);
GraphicsImportDraw(gi);
CloseComponent(gi);

> Any code samples available?

Lots at Apple's site. There are other mechanisms as well. Note that
FSSpecs are pretty much discouraged for new development, too, but
there's a simple variation on the above using the preloaded image data.

--
The best intentions in the world don't make a flawed argument magically valid.

0 new messages