| TSK | Picture datatype | 20110118 21:27 |  |
struct BitMap *bm=0;
DTFile=IDataTypes->NewDTObject(filename,
DTA_GroupID,GID_PICTURE,
PDTA_DestMode,PMODE_V43,
TAG_DONE);
if (DTFile!=0)
{
IDataTypes->GetDTAttrs(DTFile,PDTA_BitMapHeader,&bmhead,PDTA_BitMap,&bm,TAG_DONE);
}
|
|
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
thomas | Re: Picture datatype | 20110118 22:12 #1104 |  | @TSK
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);
| | |
|
TSK | Re: Picture datatype | 20110118 23:09 #1107 |  | @thomas
I was trying to do it this way:
IIntuition->IDoMethod(DTFile,DTM_PROCLAYOUT,TAG_END);
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.
| | |
|
amigo1 | Re: Picture datatype | 20110119 07:30 #1110 |  | @TSK
It would be nice if JPEG datatype would support EXIF at all! :-) | | |
|
abalaban | Re: Picture datatype | 20110119 11:41 #1113 |  | @TSK
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 | | |
|
thomas | Re: Picture datatype | 20110119 14:32 #1116 |  | @TSK
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
{
ULONG MethodID;
struct GadgetInfo *gpl_GInfo;
ULONG gpl_Initial;
};
DoMethodA takes a pointer to the structure while DoMethod takes the structure itself.
either
struct gpLayout msg = {DTM_PROCLAYOUT,NULL,1};
DoMethodA (obj,(Msg)&msg);
or
DoMethod (obj,DTM_PROCLAYOUT,NULL,1);
| | |
|
TSK | Re: Picture datatype | 20110120 21:59 #1172 |  | @thomas
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 Home |
|