Icon edit at runtime (colour picker)

  • Thread starter Thread starter Carl Gilbert
  • Start date Start date
C

Carl Gilbert

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
 
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
--------------------
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top