473,657 Members | 2,427 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.Drawin g.Bitmap)ilTool barSmall.Images[iUncheckedIconI ndex]).GetHbitm
ap()
----------
Will Pittenger
E-Mail: mailto:wi****** ******@verizon. net
All mail filtered by Qurb (www.qurb.com)
Nov 16 '05 #1
1 2270
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******** ********@TK2MSF TNGP09.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.Drawin g.Bitmap)ilTool barSmall.Images[iUncheckedIconI ndex]).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
2190
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 article about ways of protecting your images from being downloaded. It was my understanding that if the client sees it, then it's in the client cache. Am I wrong in this belief or not? I took the information in the article and created the .asp that...
3
2930
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. Can anyone shed some light on how to do this? Thanks Ray
9
3495
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 add images to my menu buttons they don't show when the form is created. But, if I don't use the XP style the images show on my buttons correctly. Can someone please explain to me what the problem is and how to get around it? Here is how I'm calling...
102
7351
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 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...
9
1607
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 for first few times only. Each time I open my form afterwards, the icons are gone and only blank buttons are visible. I did not move any folders around, so all the images are where they were and they get referenced properly. No changes to the...
4
1179
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 Enabled property set to False, at runtime, the image just disappears, leaving a square grayed area with nothing inside it. ( while it is supposed to show the image in gray color)??
6
2527
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
13348
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 http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
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 we have to send another system

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.