473,503 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copying images from toolbar image list to system menu

I have a program where I used Win32 calls to add items to my form's system
menu. Now I am attempting to have those items use the same icon that the
corresponding toolbar button uses. I thought that I could just access the
image on the fly and send it to Windows. Trouble is that results in an
image with dark blue where the image is transparent. (The menu's background
is the standard BTNFACE color.) My code is below. All need is a HBITMAP.
Windows is definitely insisting on a bitmap rather than an icon. Could
someone tell me what is wrong? Do I need to paint the image somewhere? I
would rather just copy it.

((System.Drawing.Bitmap)ilToolbarSmall.Images[iUncheckedIconIndex]).GetHbitm
ap()
----------
Will Pittenger
E-Mail: mailto:wi************@verizon.net
All mail filtered by Qurb (www.qurb.com)
Nov 16 '05 #1
1 2263
After some careful experimenting and examination of some zoomed screen
captures, I concluded that white was replaced with RGB(192, 192, 192) and
RGB(192, 192, 192) with RGB(0, 0, 192). I tried code to manually copy the
images to a new bitmap with a graphics object created from that bitmap.
That did not change anything. So I thought perhaps I could use a flood fill
to force the background to either grey or white. I had to use more Win32
code for that as I could not find a .NET flood fill. At this point, it
looks like I need to find a solution in the Win32 group. However, if anyone
here has a suggestion, I will continue to track this topic.

----------
Will Pittenger
E-Mail: mailto:wi************@verizon.net
All mail filtered by Qurb (www.qurb.com)
"Will Pittenger" <wi************@verizon.net> wrote in message
news:eq****************@TK2MSFTNGP09.phx.gbl...
I have a program where I used Win32 calls to add items to my form's system
menu. Now I am attempting to have those items use the same icon that the
corresponding toolbar button uses. I thought that I could just access the
image on the fly and send it to Windows. Trouble is that results in an
image with dark blue where the image is transparent. (The menu's background is the standard BTNFACE color.) My code is below. All need is a HBITMAP.
Windows is definitely insisting on a bitmap rather than an icon. Could
someone tell me what is wrong? Do I need to paint the image somewhere? I
would rather just copy it.

((System.Drawing.Bitmap)ilToolbarSmall.Images[iUncheckedIconIndex]).GetHbitm ap()
----------
Will Pittenger
E-Mail: mailto:wi************@verizon.net
All mail filtered by Qurb (www.qurb.com)

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2176
by: Roland Hall | last post by:
I read Aaron's article: http://www.aspfaq.com/show.asp?id=2276 re: protecting images from linked to by other sites. There is a link at the bottom of that page that references an interesting...
3
2920
by: Ray Price | last post by:
I want to use a server-side C# script to copy an image from a remote URL to a local file in the web directory. I tried using File.Copy from the System.IO namespace but it doesn't support URL. ...
9
3480
by: Terrance | last post by:
Good Afternoon: I was hoping if someone could share some light on a problem that I'm facing. When I create a Visual Basic.Net program and I use the XP style for my Window Forms and buttons; if I...
102
7273
by: me | last post by:
How do I prevent the save/print/email/mypictures toolbar from popping up when IE users place their cursor over photos at my website? Thank you in advance for your help. Signed, me
1
503
by: Will Pittenger | last post by:
I have a program where I used Win32 calls to add items to my form's system menu. Now I am attempting to have those items use the same icon that the corresponding toolbar button uses. I thought...
9
1582
by: Dino M. Buljubasic | last post by:
I have a tool bar and an image list that holds all icon images that are shown on the tool bar. However, I have noticed several times that when I add the images to the buttons on toolbar, they get...
4
1168
by: al | last post by:
Greetings, I have this problem with any image, in any format, I include in ToolBar Control. Those images are in-house developed. The problem is when I include an image in a ToolBar and have its...
6
2514
by: Neil | last post by:
I have a form that has its own custom menu bar in Access 2000. I'd like to make a copy of the menu bar and use it with another form. How can I do this? Thanks.
5
13304
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.