473,763 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Icon edit at runtime (colour picker)

Hi

I am looking to edit an icon at runtime on menu items such as change fill
colour.

I wish to replicate the features found in most applications where by the
coloured bar on a colour picker icon changes colour to the last selected
colour.

Therefore the user can easily tell which colour will be apllied when
clicking the menu item rather than droping down the colour picker to
re-select a colour.

Regards, Carl
Nov 20 '05 #1
2 1802
Hi,

Dim bm As New Bitmap(16, 16)

Dim g As Graphics = Graphics.FromIm age(bm)

g.Clear(Color.S kyBlue) ' Replace with the color selected

Dim ico As Icon = Icon.FromHandle (bm.GetHicon)
Ken
--------------------
"Carl Gilbert" <wj*****@hotmai l.com> wrote in message
news:uD******** ******@TK2MSFTN GP09.phx.gbl...
Hi

I am looking to edit an icon at runtime on menu items such as change fill
colour.

I wish to replicate the features found in most applications where by the
coloured bar on a colour picker icon changes colour to the last selected
colour.

Therefore the user can easily tell which colour will be apllied when
clicking the menu item rather than droping down the colour picker to
re-select a colour.

Regards, Carl

Nov 20 '05 #2
Hi

I have to following code, thanks to Ken, which sets up a new bitmap.

Dim bm As New Bitmap(16, 16)
Dim g As Graphics = Graphics.FromIm age(bm)
g.Clear(System. Drawing.Color.T ransparent)

Dim pn As Pen = New Pen(System.Draw ing.Color.Blue)
g.DrawRectangle (pn, 0, 13, 16, 4)

Dim tmpImg As Image = Me.imgsmImageLi st.Images(0)

Firstly does anyone know how to overlay this bitmap on the current icon
being used?
And secondly, how to draw a solid rectangle at the bottom of the bitmap.
I have managed to draw an outline, but I think this may be wrongly
positioned anyway.

Ultimately, I am trying to build a transparent bitmap (16x16), draw a
coloured rectangle (4 high x16 wide) at the bottom of the bitmap and finally
overlay this bitmap on an icon in the menu.

Any help on this would be greatly appreciated.

Regards, Car Gilbert
Nov 20 '05 #3

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

Similar topics

1
1553
by: ianruffell | last post by:
i've added an icon to an app i've written. when a shortcut is added to the desktop the icon colour is as expected. hwoever, when i run the app, both the taskbar icon and the icon on the app lose colour. if you need further details please ask. i've searched for an answer on numerous occasions but cannot find anything. your help would be greatly appreciated.
4
4900
by: Steven | last post by:
Can anyone direct me to a colour picker of the same (or similar quality) to the default .NET one but one that encompasses ability to specify colour by HEX value?
1
1490
by: Jim Heavey | last post by:
Is a ".gif" file thes same as an ".ico" file. Is there a way to turn an ..gif file into a .ico file? Do have some recommendation of a tool to use to create/edit icons? Thanks in advance for your assistance!!!!!!!!
1
1359
by: Danny Woolston | last post by:
Hi All Is there a way to change the colour of a disabled date picker, it has the back and fore colour properties but they don't seem to work, i need to change the grey to an info colour! -- Kind Regards
2
19875
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
2
3756
by: Lee | last post by:
Hi, I have a notify icon and have been trying to make the background color transparent. But do .ico files allow a transparent color? when i select the image for the notify icon it askes for type .ico. now i know i can set a transparent background with png's ect, but can i use tranparent (colors) with an ico? thanks
2
5376
by: flaper87 | last post by:
Hi everybody!!!! I am developing an aplication, and i want it to stay on the system tray, i found out how to put the icon, but i can minimize it there, What do i have to do?, I'm using python(of course). and this is the code: # -*- coding: iso-8859-1 -*- # Don't modify comment import wx
8
4937
by: GiJeet | last post by:
hello, is it possible to determine the browser and version using javascript at runtime and apply a browser specific external .css file? If so, I'd appreciate code sample so I can see how it's done. TIA G
4
1981
by: Arun | last post by:
I came across a message sometime back in 2002. Here's a link: http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/f10e3748f6f260c5/b0b1ac5840e445e5?lnk=gst&q=color+picker#b0b1ac5840e445e5. The author tries to build a colour picker from scratch but his overuse of <tdtags puts me off the solution. Here is something I just created. It uses prototype, just because it makes life easier for me. .... <head> <script...
0
9563
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
10145
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
9998
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...
0
9822
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
8822
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3917
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
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.