Discussion:
Best image format for toolbar and menu items
(too old to reply)
b***@gmail.com
2015-04-19 09:46:27 UTC
Permalink
Have a VB6 form with a toolbar (the regular one from MSCOMCTL.OCX) and a menu bar and right-click popup menus. Having some trouble figuring out what the best format is for the images to go with the toolbar buttons and with the right-click popup menu items. The images are in a regular Imagelist control.
I am adding images to the popup menu items with the GetMenu, GetSubMenu and the SetMenuItemBitmaps API's.
I think the SetMenuItemBitmaps API needs .bmp file images, so I use these for the toolbar buttons as well. The problem now is to edit these .bmp images, so that the background is transparent, so it blends nicely with the toolbar. I am not sure this can be done. Been trying with Irfanview for a while, but no success.
I could use a different format for the toolbar buttons, but then I lose the consistency as the popup menu items will have a different image.
Could anybody advise me what the best way to go is with this?
I could also do with good source (website or else) to get a good choice of images for this.

Thanks in advance for any advice, RBS
Eduardo
2015-04-19 11:17:54 UTC
Permalink
Post by b***@gmail.com
The problem now is to edit these .bmp images, so that the background is
transparent, so it blends nicely with the toolbar.
I use bmp files stored in a ImageList bounded to the toolbar, and set the
proper MaskColor in the ImageList
b***@gmail.com
2015-04-19 11:53:48 UTC
Permalink
Post by Eduardo
Post by b***@gmail.com
The problem now is to edit these .bmp images, so that the background is
transparent, so it blends nicely with the toolbar.
I use bmp files stored in a ImageList bounded to the toolbar, and set the
proper MaskColor in the ImageList
Yes, I did same, specified white as the mask colour, but image doesn't appear
transparent in either toolbar buttons or the popup menu items. Maybe there is
something wrong with the .bmp files.

RBS
Eduardo
2015-04-19 13:08:14 UTC
Permalink
Post by b***@gmail.com
Yes, I did same, specified white as the mask colour, but image doesn't appear
transparent in either toolbar buttons or the popup menu items. Maybe there is
something wrong with the .bmp files.
Check if the white specified is not a system color like the window
background color.
b***@gmail.com
2015-04-19 13:31:01 UTC
Permalink
Thanks, but for now (while experimenting) I have set the mask colour in code,
so, imgListEditor.MaskColor = ColourMaskImageListControl, where ColourMaskImageListControl is a Long variable.
I do this is the Form Load event and that seems to work fine.

RBS
Post by Eduardo
Post by b***@gmail.com
Yes, I did same, specified white as the mask colour, but image doesn't appear
transparent in either toolbar buttons or the popup menu items. Maybe there is
something wrong with the .bmp files.
Check if the white specified is not a system color like the window
background color.
Norm Cook
2015-04-19 11:35:03 UTC
Permalink
And for menu items, White will be the transparent color.
b***@gmail.com
2015-04-19 12:17:59 UTC
Permalink
Post by Norm Cook
And for menu items, White will be the transparent color.
The problems seems to be when I specify white for the transparent colour.
One of the images has rgb(192,192,192) as the colour I want to make transparent
and if I use that as the mask colour, it works, so the image shows transparent
in the toolbar button.

RBS
GS
2015-04-20 13:09:58 UTC
Permalink
Post by b***@gmail.com
Post by Norm Cook
And for menu items, White will be the transparent color.
The problems seems to be when I specify white for the transparent
colour. One of the images has rgb(192,192,192) as the colour I want
to make transparent and if I use that as the mask colour, it works,
so the image shows transparent in the toolbar button.
RBS
It might be worth placing the transparent image over a white
background, then recreate the image so it now has white as its
transparent color. This works for me quite well, regardless of final
output format (bmp, jpg, gif...)
--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Schmidt
2015-04-22 00:35:06 UTC
Permalink
Post by b***@gmail.com
...
I could use a different format for the toolbar buttons,
but then I lose the consistency as the popup menu items
will have a different image.
Could anybody advise me what the best way to go is with this?
Since I know you as an old hand with vbRichClient5
(though mainly in conjunction with SQLite) - and in case
you use this library already for the App in question,
you might want to take a look at this Demo here:

http://www.vbforums.com/showthread.php?765051-VB6-Dynamic-Menu-Popup-and-Toolbar-Demo-%28vbRichClient-based%29

Olaf
b***@gmail.com
2015-04-22 22:30:03 UTC
Permalink
Hi Olaf,

Will have a look at that demo. I came in fact across this just today via this
link:
http://www.medicalhouseholdsupplies.com/showthread.php?765051-VB6-Dynamic-Menu-Popup-and-Toolbar-Demo-(vbRichClient-based)&s=70ab3adf1db1d0b157be5eb1bce27cfb&p=4682219&viewfull=1

But looks to be hacked and causing (false?) security threats.

I had a quick look at it (not tried yet), but couldn't see where it all gets added to the form. Is this for a normal VB6 form or is this only for a Cairo widget form?

RBS
Post by Schmidt
Post by b***@gmail.com
...
I could use a different format for the toolbar buttons,
but then I lose the consistency as the popup menu items
will have a different image.
Could anybody advise me what the best way to go is with this?
Since I know you as an old hand with vbRichClient5
(though mainly in conjunction with SQLite) - and in case
you use this library already for the App in question,
http://www.vbforums.com/showthread.php?765051-VB6-Dynamic-Menu-Popup-and-Toolbar-Demo-%28vbRichClient-based%29
Olaf
Schmidt
2015-04-22 23:09:17 UTC
Permalink
Post by b***@gmail.com
Will have a look at that demo. I came in fact across this just today via this
http://www.medicalhouseholdsupplies.com/showthread.php?765051-VB6-Dynamic-Menu-Popup-and-Toolbar-Demo-(vbRichClient-based)&s=70ab3adf1db1d0b157be5eb1bce27cfb&p=4682219&viewfull=1
But looks to be hacked and causing (false?) security threats.
Yeah, somebody is mimicking the original vbForums-Site behind
his own domain - really dubious.
Post by b***@gmail.com
I had a quick look at it (not tried yet),
but couldn't see where it all gets added to the form.
I've explained that at the beginning of the article:

--- The contained Modules of the Demo:
---
---modMenuResources.bas
---<small code-listing of about 50 lines>
---
---and modToolBarResources.bas
---<small code-listing of about 20 lines>
---
---contain the lines of code which are needed,
---to construct and achieve the following output:
---<ScreenShot of a quite complex Menu- and Toolbar-structure>
Post by b***@gmail.com
Is this for a normal VB6 form or is this only for a Cairo widget form?
The Demo is using a normal VB-Form (only the PopUp-Form is "native RC5")

You will need to play around with it a bit - but I think the
construction-code for the whole scenario cannot get any easier
(basically one line of code per Menu- or Toolbar-entry).

Olaf
b***@gmail.com
2015-04-23 08:31:26 UTC
Permalink
I didn't realise this was a long thread with a download many postings further down. I take it I need this download and the lines of codes in the first post
are not enough to set it all up.

RBS
Post by Schmidt
Post by b***@gmail.com
Will have a look at that demo. I came in fact across this just today via this
http://www.medicalhouseholdsupplies.com/showthread.php?765051-VB6-Dynamic-Menu-Popup-and-Toolbar-Demo-(vbRichClient-based)&s=70ab3adf1db1d0b157be5eb1bce27cfb&p=4682219&viewfull=1
But looks to be hacked and causing (false?) security threats.
Yeah, somebody is mimicking the original vbForums-Site behind
his own domain - really dubious.
Post by b***@gmail.com
I had a quick look at it (not tried yet),
but couldn't see where it all gets added to the form.
---
---modMenuResources.bas
---<small code-listing of about 50 lines>
---
---and modToolBarResources.bas
---<small code-listing of about 20 lines>
---
---contain the lines of code which are needed,
---<ScreenShot of a quite complex Menu- and Toolbar-structure>
Post by b***@gmail.com
Is this for a normal VB6 form or is this only for a Cairo widget form?
The Demo is using a normal VB-Form (only the PopUp-Form is "native RC5")
You will need to play around with it a bit - but I think the
construction-code for the whole scenario cannot get any easier
(basically one line of code per Menu- or Toolbar-entry).
Olaf
Schmidt
2015-04-23 08:50:18 UTC
Permalink
Post by b***@gmail.com
I didn't realise this was a long thread with a download many postings further down. I take it I need this download and the lines of codes in the first post
are not enough to set it all up.
No, the very first post contains a Dowload-Link (at the end of
this posting #1) to a demo-project (which in the discussion was
constantly enhanced).

This Zip contains everything to run the Demo (when the RC5
was installed, which I assume you already have - latest version
is 5.0.26 with a recent SQLite 3.8.9)

Olaf
b***@gmail.com
2015-04-23 08:56:03 UTC
Permalink
OK, thanks for clearing that up and will try it out.

RBS
Post by Schmidt
Post by b***@gmail.com
I didn't realise this was a long thread with a download many postings further down. I take it I need this download and the lines of codes in the first post
are not enough to set it all up.
No, the very first post contains a Dowload-Link (at the end of
this posting #1) to a demo-project (which in the discussion was
constantly enhanced).
This Zip contains everything to run the Demo (when the RC5
was installed, which I assume you already have - latest version
is 5.0.26 with a recent SQLite 3.8.9)
Olaf
GS
2015-04-22 23:11:39 UTC
Permalink
Bart,
FWIW, I've had good success with commandbar stuff found here...

http://www.vbaccelerator.com/home/VB/Code/Controls/index.asp

..since it lets me manage these same as managing commandbars in Excel.
Just assign images to a property and go!
--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
b***@gmail.com
2015-04-23 10:30:24 UTC
Permalink
Thanks, will have a look at that one as well.

RBS
Post by GS
Bart,
FWIW, I've had good success with commandbar stuff found here...
http://www.vbaccelerator.com/home/VB/Code/Controls/index.asp
..since it lets me manage these same as managing commandbars in Excel.
Just assign images to a property and go!
--
Garry
Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Continue reading on narkive:
Loading...