473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1777
Hi,

Dim bm As New Bitmap(16, 16)

Dim g As Graphics = Graphics.FromImage(bm)

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

Dim ico As Icon = Icon.FromHandle(bm.GetHicon)
Ken
--------------------
"Carl Gilbert" <wj*****@hotmail.com> wrote in message
news:uD**************@TK2MSFTNGP09.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.FromImage(bm)
g.Clear(System.Drawing.Color.Transparent)

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

Dim tmpImg As Image = Me.imgsmImageList.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
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...
4
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
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...
1
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! -- ...
2
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
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...
2
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...
8
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...
4
by: Arun | last post by:
I came across a message sometime back in 2002. Here's a link:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...

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.