BitMapObject -> Datatype

6 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 6 months 6 days ago
Joined: 2014-04-21 21:15
BitMapObject -> Datatype
Currently in my program I am loading a handful of images as BitMapObject. Is it possible to use NewDTObject() to "load" it and scale it, keeping the original in tact?
  1. dto = NewDTObject(NULL,
  2. DTA_SourceType, DTST_MEMORY,
  3. DTA_SourceAddress, Object[IMG_IMAGE1],
  4. DTA_SourceSize, sizeof(Object[IMG_IMAGE1]),
  5. DTA_GroupID, GID_PICTURE,
  6. PDTA_DestMode, PMODE_V43,
  7. TAG_DONE);
Then do some scaling on the new object. That is not correct; just showing as an example of what I am wanting to do. The images get used dozens of times. I don't want to have to keep reloading them over and over.
Massi
Massi's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2012-03-28 17:16
@mritter0 I used datatypes
@mritter0 I used datatypes to load an image and then IGraphics->CompositeTags() to scale it. Loaded and scaled are distinct images. Have a look at my image viewer HottiesView available from OS4 Depot, file HottiesView.c, LoadImageARGB32() and ScaleImage() methods.
mritter0
mritter0's picture
Offline
Last seen: 6 months 6 days ago
Joined: 2014-04-21 21:15
Nice. Best example code I
Nice. Best example code I have seen. I have an idea on how to do what I envisioned. Thanks!
mritter0
mritter0's picture
Offline
Last seen: 6 months 6 days ago
Joined: 2014-04-21 21:15
I used your p96 bits of code
I used your p96 bits of code to load and scale (CompositeTags()). All is working the way I hoped. EXCEPT....none of the images have the transparency shown correctly; all have black backgrounds instead. I am using the main image code, not the thumbnail code. I am on OS4.1FE using WinUAE so not a real 32bit video card. Is that all the problem is, or is there something more I need for the transparency? ReAction BitMap objects handle the transparency correctly. Thanks for the code. It really helped.
Massi
Massi's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2012-03-28 17:16
@mritter0 I used your p96
@mritter0
I used your p96 bits of code to load and scale (CompositeTags()). All is working the way I hoped. EXCEPT....none of the images have the transparency shown correctly; all have black backgrounds instead. I am using the main image code, not the thumbnail code.
Well I don' t know exactly what you are doing and how. My source code uses IGraphics->CompositeTags() to make the transparency effect, search for "Blitting with alpha blend" comments.
I am on OS4.1FE using WinUAE so not a real 32bit video card. Is that all the problem is, or is there something more I need for the transparency? ReAction BitMap objects handle the transparency correctly.
OS4 emulated is not officially supported and I heard the current emulation has some limitations (128 MB RAM, 4 MB GFX RAM, no compositing, no overlay, no 3D).
Thanks for the code. It really helped.
You are welcome.
mritter0
mritter0's picture
Offline
Last seen: 6 months 6 days ago
Joined: 2014-04-21 21:15
Sorry. Not transparency like
Sorry. Not transparency like you are doing with the thumbnail image. Alpha channel transparency for the background. They all show with black backgrounds for PNGs. I tried several different options but can't get it to work right.
Log in or register to post comments