I'm struggling with an attempt to simply open a picture file via DataTypes, add the object to a window, and get a reasonably good image. This is AOS4.1 Upd 4, Picture Datatype 53.6, JPG Datatype 53.5
I'm calling NewDTObjectA() on the file name successfully.
I GetDTAttrsA() successfully for DTANominalVert and DTANominalHoriz.
Open a WB window plenty big enough.
SetDTAttrsA() for GA_Left, GA_Top, GA_Width, and GA_Height to avoid the window borders.
AddDTObject() to the window.
Delay a bit and then RefreshDTObjectA().
I'm expecting to see something like Multiview shows, and it does for IFF and GIF files, but JPG files show the image, but in a poor quality. It looks like the picture has attempted to use too few colors and dithered into graininess.
GetDTAttrsA() for PDTANumColors always returns 16.
I've tried SetDTAttrsA() to increase that value, and to set PDTA_NumAlloc to a high value. But no change.
Can anyone point me to the type of things Multiview must be doing with this?
Thanks,
Tom
Hi Tom,
Here's an example that does woerk. It is a rewrite (= turned to OS4) of one of corto's sources.
Have fun with it.
OldFart
Set PDTA_DestMode,PMODE_V43 in NewDTObject.
@OldFart
@thomas
Thanks for the replies. I had tried PMODE_V43, but set it to the wrong tag, PDTA_SourceMode instead of PDTA_DestMode.
Once I changed to PDTA_DestMode, the picture looks very good, and it is very simple to use DataTypes for the display of JPG as well as GIF and IFF.
Probably accessing the BitMap and other details would be useful for doing something else with the image, but for display it seems to be just
NewDTObject()
AddDTObject()
RefreshDTObject()
nice.
Tom