![]() |
CommandBars.Icons.LoadBitmap / Mask |
Post Reply ![]() |
Author | |
indices ![]() Groupie ![]() Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() Posted: 30 October 2007 at 1:14pm |
Does the CommandBars.Icons.LoadBitmap method apply a mask on the loadded bitmap?
I am loading several BMP files with background color however when I use the code below to draw the icon, the background is missing.
Set Icon = CommandBars.Icons.GetImage(Item.ID, 32)
Icon.Draw HDC, X + 5, Y + 5, 32, 32, xtpImageNormal
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Topleft pixel in bitmap used for transparent color
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
indices ![]() Groupie ![]() Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Is there any way I can force it not to apply the mask?
These bmps are non-transparent and being loaded into a gallery.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Set MaskColor to some value before you load them.
CommandBars.Icons.MaskColor = vbRed
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Krog ![]() Groupie ![]() Joined: 06 February 2008 Status: Offline Points: 100 |
![]() ![]() ![]() ![]() ![]() |
How can I load my bitmaps without using any MaskColor at all? I don't want to loose any color on the bitmap.
I did not find a property like UseMaskColor on the ImageManager.Icons. Thanks in advance. |
|
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2 Language: Visual Basic 6 SP6 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Just set it to some value > 0xFFFFFF
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Krog ![]() Groupie ![]() Joined: 06 February 2008 Status: Offline Points: 100 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg!
I tested it and it is the same as if the value does not have the 0xff000000 part. eg. 0x1000000 gives me equal results as 0x00 ![]() Also with pictures that does have less than 24 bits per pixel (not RGB), as some GIFs, the mask applies to black (0x00) color. My code is like this:
Happy Holidays! |
|
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2 Language: Visual Basic 6 SP6 |
|
![]() |
|
shipwreck ![]() Senior Member ![]() ![]() Joined: 18 April 2008 Location: United States Status: Offline Points: 308 |
![]() ![]() ![]() ![]() ![]() |
Hello Krog and indice.
Typically, I prefer to use .png files as icons rather than the usual bitmap because they support higher color bit and built in transparancies. If you would like to see an example code let me know. ;] |
|
![]() |
|
Krog ![]() Groupie ![]() Joined: 06 February 2008 Status: Offline Points: 100 |
![]() ![]() ![]() ![]() ![]() |
Hi Donald!
I sometimes use png files for icons too, when the icon has only one image size. But in this case I am using the ImageManager as a intermediate control to show larger images on markup controls. And the user can select any image from its computer. And in this case the masking is not desired. Thanks! |
|
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2 Language: Visual Basic 6 SP6 |
|
![]() |
|
shipwreck ![]() Senior Member ![]() ![]() Joined: 18 April 2008 Location: United States Status: Offline Points: 308 |
![]() ![]() ![]() ![]() ![]() |
Different sizes should be a problem with the seticonsize method. But that too is a great work around. Thanks
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() 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 |