[futurebasic] Re: [FB] Displaying a bitmap

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1999 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Sat, 27 Nov 1999 14:41:34 -0800
Charlie Dickman wrote:

> >  > Fellow FBers,
> >  >
> >  > If I have an icon bitmap in memory how do I display it in a rect on
> >  > the screen? Is it a copybits call? If so, what are the bitmap
> >  > parameters? Do I have to (somehow) put it into a GWorld first? If so,
> >  > how? Does it go nicely into an edit field? How?
> >  >
> >  > Any info will be greatly appreciated.
> Thanks to everyone who responded to my plea but I'm afraid I confused
> the situation by using the word "icon". What I have is a bitmap
> retrieved from the desktop database via PBDTGetIcon. It is not a
> resource that can be drawn with DRAWCICON or any other routine
> intended to dray icon resources. Nor is it a PICT resource or a
> picture created with PICTURE ON/OFF.
> I tried specifying the handle to PICTURE FIELD and get an empty
> picture field. If i feed the handle to COPYBITS I get a memory access
> crash (even though the FBII Handbook says that COPYBITS can handle
> bitmaps (I'm probably feeding it the wrong address via #hndl&+2)).
> Can anybody suggest a next move?

Hi Charlie,

According to IM, you ARE retrieving the bitmap for an Icon that represents a
file of a given type and creator. It is described in detail in IM: More
Macintosh Toobox, page 9-12. I'm using the Toolbox Assistant onscreen version
myself. I could not locate PBDTGetIcon in the Toolbox calls, so I wonder if,
perhaps, it is not supported by FB - II or 3. However, it appears that, before
you call this FN, you need to load the PB with certain information so it knows
what you're looking for, and the bitMap is then returned in the ioDTBuffer,
which is a "pointer" to a buffer that holds the icon's data. To test whether
your call worked you should be able to read the ioResult. This is all "fairly"
complex. Are you sure you set up everything properly in the first place? I
suspect you've been trying to display invalid data.

Joe Wilkins