Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, September 17, 2006 2:51:21 PM(UTC)

Kritor  
Kritor

Groups: Registered
Posts: 7


Hi,
 
I am using LeadTools Raster Imaging v14.0 Toolkit with latest v14 patch, with Visual Studio 2005 using C++ MFC.
 
I am making an image converter software, but having some problems converting a transparent GIF image into a transparent ICON. After loading the image, I check the BitmapTransparentColor and BitmapEnableTransparent of the opened image and they return true and the correct transparent color, so the saved image should contain those values aswell. It all results in when saving the icon having black/red etc background (depending on the background color that's supposed to be the transparent color).
 
The same thing happens if you use the included "01 MFC Main Demo" of the Raster Imaging Toolkit and open a transparent GIF file, resize it to e.g. 32x32 (as required by the icon format) and then save it as an icon. In the Main Demo program, it shows the GIF file correctly with the transparent color, but the saved icon doesn't have a transparent color.
 
Thanks for your help!
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, September 19, 2006 12:45:00 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

To save a transparent Windows ICON, you need to define a region in the LEADTOOLS bitmap, then save the bitmap as Windows Icon using our LEADTOOLS Save functions. You can try this using the Main C++ ClassLib demo.

Please let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, September 19, 2006 4:02:33 AM(UTC)

Kritor  
Kritor

Groups: Registered
Posts: 7


Hi,
 
Thanks for your reply.
 
By defining a region, do you mean I need to define a region of where the transparency is and then set some color in that region, or just define a region of the whole bitmap and save the bitmap? I'm pretty new to Leadtools Raster and haven't used any region functions yet.
 
#4 Posted : Tuesday, September 19, 2006 10:35:42 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

You need to set a region to the area that you want show in the ICON image when you save it.
For example, if you have an image with a Black background and you want to set the black as transparent in the result ICON file, the region area should not contain the Black background. You can use the LBitmapRgn::SetRgnColor to add the region that consists of all the pixels of a specified color (Black RGB(0,0,0)) and you need to set the LBitmapRgn::SetRgnCombineMode to L_RGN_SETNOT.

For more information, please refer to the LEADTOOLS Class Library Help file and read the following topics:
- LBitmapRgn::SetRgnColor
- LBitmapRgn::SetRgnCombineMode
- Creating a Bitmap Region.

Please let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Wednesday, September 20, 2006 5:31:33 AM(UTC)

Kritor  
Kritor

Groups: Registered
Posts: 7


Awesome! It works! :)
 
Thanks a lot!
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.083 seconds.