imageclass return type

3 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
imageclass return type

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:

  1.  
  2. IIntuition->GetAttrs(LocalIDDNode->ImgObj,
  3. IA_Width, &BMWidth,
  4. IA_Height, &BMHeight,
  5. TAG_DONE);
  6. IIntuition->SetAttrs(LocalIDDNode->ImgObj,
  7. IA_Top, CurrTop-IDD->FontXSize,
  8. IA_Left, BoxRectangle.MinX,
  9. IA_Width, BMWidth,
  10. IA_Height, BMHeight,
  11. TAG_DONE);
  12.  
  13. IGraphics->Move(rp,CurrLeft,CurrTop);
  14. 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?

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
Re: imageclass return type

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.

mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
Re: imageclass return type

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.

Log in or register to post comments