[Solved] Convert image 24bit to 32bit with convert2bmp

Jun 28, 2010 at 5:36 PM
Edited Jun 28, 2010 at 6:54 PM
Hello, i don't know hoy to convert a bmp image to 32bit with convert2bmp and I've also seen your blog and your posts in Codeplex, but i haven't seen how to use convert2bmp. If i edit a image of your project, it can be shown in the project (application) but if i assign an own image to the project, it can't be shown (it's 32bit bmp). I need help Best regards
Jun 29, 2010 at 1:31 AM
Open cmd (if you're using windows os, run->cmd), cd to where your images are (cd c:\users\dell\desktop\image folder), then you can use it this way ( convert2bmp <source> <target>; convert2bmp source24.bmp source32.bmp) make sure that the images and the .exe are in the same folder
Jun 29, 2010 at 12:15 PM
This is correct. convert2bmp source24.bmp source32.bmp
Apr 10, 2011 at 5:30 PM

This PowerShell script will do the same as convert2bmp. This example converts all PNG files in a folder to 32bpp bitmaps. The transparent color can also be changed easily.

Get-Item "*.png" | % {
    $FileName = [IO.Path]::GetFileNameWithoutExtension($_)
    $Bitmap = [Drawing.Image]::FromFile($_.FullName)
    $Bitmap.Save("$FileName.bmp", [Drawing.Imaging.ImageFormat]::Bmp)

Apr 10, 2011 at 11:59 PM


Mar 24, 2013 at 7:44 AM
Edited Mar 24, 2013 at 7:46 AM
When I use convert2bmp to convert my transparent ping images, it successfully creates bitmap versions of the images that display on the ribbon.

...However, it seems to be converting transparent parts of the image black (which is normal/expected, but it's also converting the color white to black as well.

For example, I have a transparent ping icon image that is a round circle shape with a transparent background, and the symbol inside the circle (a plus sign, +) is colored white. When I convert the image and display it on the blue ribbon, it displays, but the plus sign is blue instead of white.

I've tried opening my ping images in photoshop cs5 and placing them over a black colored layer and saving as a bitmap (32 bit), but when I try to use it on my ribbon, it compiles no problem, but simply doesn't show the image at all on the ribbon button.

I've been using this ribbon for quite a long time, but previously I've been loading them like this:
_Button_AddItem.LargeImage = Ribbon1.ConvertToUIImage(My.Resources.add_icon) 
' where "add_icon" is a transparent ping.  This displays on the ribbon perfectly.
Although this method allows me to use transparent ping images directly without converting them to bitmap, they occasionally don't load at all, and I get fully functional ribbon buttons, but no images on them.

How do I convert my transparent ping images and leave the white colored parts alone/leave the white parts white and not make white transparent/black too?

Please help...