Home  News  Recent  Forums  Search  Contact


   Register here

 Main menu
   View images
   BBCode test
   Statement of intent
   Terms Of Service
   IRC Channel
   List Content

 In cooperation with

  Amiga Flame
  Amiga Spirit
  View comments
      AmigaOS 4  
TSKPicture datatype20110118 21:27

struct BitMap *bm=0;
if (DTFile!=0)

Why bitmap pointer bm is always null ? I was expecting to get a pointer to the bitmap of the picture. I get a pointer to Bitmap header which contains correct width and height values for the picture which means it's loaded. (I use ObtainBitMapSource() usually instead of datatypes lib. But I'm curious.)
Navigate: 1-6 
thomasRe: Picture datatype20110118 22:12  #1104

The bitmap is only created during layout processing. Layout is done automatically if you add the datatype object to a window as a gadget. If you don't want to add it to a window, you have to call the layout method manually. Add this before GetDTAttrs:

IIntuiton->IDoMethod (DTFile,DTM_PROCLAYOUT,NULL,1);
TSKRe: Picture datatype20110118 23:09  #1107

I was trying to do it this way:

Thanks ! Now it works. I'm always lost with IDoMethod() and IDoMethodA() and their parameters.

@AOS devs
I have a feature request. It would be nice if Jpeg datatype supported Exif thumbnails.
amigo1Re: Picture datatype20110119 07:30  #1110

It would be nice if JPEG datatype would support EXIF at all! :-)
abalabanRe: Picture datatype20110119 11:41  #1113

You might re-read my thread on utilitybase (where you just posted yesterday), you'll find all the answers.
You can also access the code paste I did there : http://utilitybase.com/paste/wOZ. Only remember two of my errors (spotted in the thread, but for lazy persons I'll sum them here):
- DTM_PROCLAYOUT *must* receive parameters 0 and 1, so call to it must be replaced by IDoMethod(pLogoDT, DTM_PROCLAYOUT, 0, 1)
- Do NOT DisposeDTObject() unless you are finished with using any of the retrieved data
thomasRe: Picture datatype20110119 14:32  #1116

The DoMethod function does not take a tag list, therefore TAG_END or any TAG_#? does not belong there.

DoMethod gets the method's parameter structure on the stack. The parameter structure of DTM_PROCLAYOUT consists of three longwords. It's the same structure as used for GM_LAYOUT.

struct gpLayout
struct GadgetInfo *gpl_GInfo;
ULONG gpl_Initial;

DoMethodA takes a pointer to the structure while DoMethod takes the structure itself.


struct gpLayout msg = {DTM_PROCLAYOUT,NULL,1};
DoMethodA (obj,(Msg)&msg);


TSKRe: Picture datatype20110120 21:59  #1172

Now I understand. DoMethod takes structures. So when one knows which method to call then you have to find the related structure from Autodocs/includes and then you know which parameters to put there. I've always wondered why the parameters varies quite a lot, when looking example source codes.

(Back in 90s I didn't bother to study Gadtools or MUI. When I got my AmigaOne I decided to learn BOOPSI/Reaction so I'm quite newbie in this area.)
Navigate: 1-6 
Snack! forum website engine, Created in 2008 by Björn Hagström