Print Page | Close Window

CommandBars.Icons.LoadBitmap / Mask

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8604
Printed Date: 26 June 2024 at 8:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBars.Icons.LoadBitmap / Mask
Posted By: indices
Subject: CommandBars.Icons.LoadBitmap / Mask
Date 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
 

       



Replies:
Posted By: Oleg
Date Posted: 30 October 2007 at 1:34pm
Hi,
 
Topleft pixel in bitmap used for transparent color


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: indices
Date Posted: 30 October 2007 at 3:53pm
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.


Posted By: Oleg
Date Posted: 31 October 2007 at 2:14am
Hello,
 
Set MaskColor to some value before you load them.
 
CommandBars.Icons.MaskColor = vbRed


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Krog
Date Posted: 12 December 2009 at 12:20am
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


Posted By: Oleg
Date Posted: 14 December 2009 at 6:20am
Hi,
 
Just set it to some value > 0xFFFFFF


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Krog
Date Posted: 29 December 2009 at 9:57pm
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:

ImageManager1.Icons.MaskColor = GetRGBColor(UserControl.BackColor) '&H1000000 '&H1000001 'False '0
ImageManager1.Icons.AddBitmap Img.Handle, 100 + Index, xtpImageNormal, False
Set imImage = ImageManager1.Icons.GetImage(100 + Index, 0)

Happy Holidays!


-------------
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6


Posted By: shipwreck
Date Posted: 30 December 2009 at 3:06am
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. ;]



Posted By: Krog
Date Posted: 30 December 2009 at 4:30am
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


Posted By: shipwreck
Date Posted: 30 December 2009 at 6:48am
Different sizes should be a problem with the seticonsize method. But that too is a great work around. Thanks



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net