News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Has anyone used 24 bit or 32 it images in toolbars ?

Started by hutch--, June 26, 2008, 02:35:04 PM

Previous topic - Next topic

hutch--

I am reasonably well geared for 16 colour and 256 colour resources like bitmaps for toolbars but an RGB 24 bit image cannot use the LoadImage() API using the transperent flag so you do not automatically have a way to set the images on the toolbar with transparent background.

Has anyone played with this stuff, the images from XP and Vista that I can get on the internet are in PNG format but RC.EXE does not appear to be able to handle them as direct images.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

24/32 has no palette, so setting transparency must be a lot more difficult. One way would be to define once which pixels are supposed to be transparent, in a separate file containing pointers to their positions inside the bitmap, then replace these pixels each time with the background colour.

hutch--

In terms of appearance 24 bit would be fine and its easy enough to set a background in the toolbar ribbon bitmap that needs to be treated as trandparent but I am not sure of the best way to do this. I have in the past used FloodFill to do this on 16 colour image data but I don't know if it works on 24 bit.

I am in an unusual situation that I have all of the old stuff that does 16 colour bitmaps and a couple of high end photographic apps that handle 24 and 48 bit and CMYK but nothing really useful for 256 colour bitmaps. If I compose button images in either AXcursors or Awicons and try and paste them into mspaint, I lose most of the gradient colours.

Its probably senile decay setting in but I used to know how to control what colours are used in a 256 colour bitmap so you could clock up the gradient range you need while easily staying under the colour count but I am not having much success with this at the moment. Anyone know of a decent 256 colour bitmap editor ?
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

zooba

I use IcoFX for that sort of stuff. It's directed at icons but can export to BMP and PNG (and a few other formats like JPG that you wouldn't ever use for toolbars :P ). It supports up to 256x256, 32-bit with alpha channel images and exports these to PNG correctly (AFAICT, they seem to work fine). The editing is pretty simple, I tend to use my old version of Paint Shop Pro for most stuff, then feed it through IcoFX for doing the alpha channel and saving as ICO (or working PNG).

For entire toolbar image strips 256 width may not be enough. Donkey's Toolbar Paint may be better suited here. It supports up to 32-bit images, though doesn't say anything specifically about alpha channels.

Cheers,

Zooba :U

hutch--

I may have got older but I just got a bit wiser, I messed around with my Micrografx image software and made a sample that has just on 100 colours in it, converted it to 256 colour and it saved at 1.5k so the trick is to make a bitmap in 256 colour with a predefined colour table and then create the bitmap in that set of colours and you will get the gradient colours you want without any extras that you don't use and get a smaller file for the effort.  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

Quote from: hutch-- on June 27, 2008, 08:15:49 AM
converted it to 256 colour

I thought you actually needed the full 24 bit...
Anyway, in case you'll ever need toolbars with photos and transparency, the scheme outlined above would work; however, given that jpg is not a lossless format, one would need a parallel file with the pixel positions, and set the transparent pixels in memory each time the toolbar is loaded. A challenge for assembler programmer  :bg

PBrennick

I use PSP and do much the same as Hutch, I start out using the maximum amount of colors allowed, create the picture and then reduce it to 256 so that PSP will create a special palette for that picture. This is especially important if you are performing a capture so as to make sure you get the colors right when the count is reduced. I recently discovered that my LCD screen was not showing me some shading discrepancies that a monitor will show and had to come up with that method.

Paul
The GeneSys Project is available from:
The Repository or My crappy website