A friend gave me his source code for an imageclass. It simply draws a box with some text in it. I have been then putting that image in a button class using BUTTON_RenderImage, or a label class using Label_Image. It displays fine in those.
What is the "format" of the imageclass object? Autodocs say its a BOOPSI image object.
I am trying to get it to display in my gadgetclass. I can pass a previously loaded image (Object *) from disk, that are put in a BitMap class, and it displays just fine. But the imageclass image will not. I have tried to get it into a BitMapClass, BltBitMapTags(), etc.
To display the image I do:
IIntuition->GetAttrs(LocalIDDNode->ImgObj, IA_Width, &BMWidth, IA_Height, &BMHeight, TAG_DONE); IIntuition->SetAttrs(LocalIDDNode->ImgObj, IA_Top, CurrTop-IDD->FontXSize, IA_Left, BoxRectangle.MinX, IA_Width, BMWidth, IA_Height, BMHeight, TAG_DONE); IGraphics->Move(rp,CurrLeft,CurrTop); IIntuition->DrawImageState(rp,(struct Image *)LocalIDDNode->ImgObj,0,0,IDS_NORMAL,dri);
Somehow Button and Label class are doing/know something I don't to get the imageclass object to display. Any ideas?
The public portion of a BOOPSI image class object is a struct Image as defined in intuition/intuition.h.
Normally you would put the right coordinates in the DrawImageState call and leave the attributes alone.
Note that intuition and graphics are different programming layers, you cannot mix them. An image is not a bitmap and you cannot use graphics.library functions with it.
I figured it out.
I was setting the Left/Top in SetAttrs() call. This works for bitmaps but not imageclass objects. I put the same Left/Top at the 0,0 in DrawImageState() and it worked.
Thanks for the help.