By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,061 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,061 IT Pros & Developers. It's quick & easy.

Overlay bitmap on icon

P: n/a
Hi

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

'set up a transparent 16x16 bitmap
Dim bm As New Bitmap(16, 16)
Dim g As Graphics = Graphics.FromImage(bm)
g.Clear(System.Drawing.Color.Transparent)

'draw a rectangle on the transparent bitmap
Dim pn As Pen = New Pen(System.Drawing.Color.Blue)
g.DrawRectangle(pn, 0, 13, 16, 4)

'get the icon image to be modified
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 #1
Share this Question
Share on Google+
2 Replies


P: n/a
http://www.vbdotnetheaven.com/
Carl Gilbert wrote:
Hi

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

'set up a transparent 16x16 bitmap
Dim bm As New Bitmap(16, 16)
Dim g As Graphics = Graphics.FromImage(bm)
g.Clear(System.Drawing.Color.Transparent)

'draw a rectangle on the transparent bitmap
Dim pn As Pen = New Pen(System.Drawing.Color.Blue)
g.DrawRectangle(pn, 0, 13, 16, 4)

'get the icon image to be modified
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 #2

P: n/a
This site looks good but it's rather large. But can anyone suggest what to
look for?
"Supra" <su*****@rogers.com> wrote in message
news:pT*********************@twister01.bloor.is.ne t.cable.rogers.com...
http://www.vbdotnetheaven.com/

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.