473,320 Members | 2,189 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,320 software developers and data experts.

Overlay bitmap on icon

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
2 2313
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gandalf | last post by:
Hi Gurus! Here is a problem with wxPython. I would like to load bitmaps and create a mask for them at once. Here is my idea: the mask colour for the bitmap should be the colour of the pixel in...
1
by: sendhil | last post by:
hi, Iam doing some graphics programming with C#. I have to create a Windows MetaFile from a base64 encoded string. How do i create the file. I want to Overlay this Windows MetaFile on a image...
5
by: Brian Lowe | last post by:
My web site accepts uploaded photos and stores them in a SQL table as BLObs so they never touch the filesystem. I have a way to create a thumbnail version of the uploaded image and store that in...
2
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I...
6
by: Lespaul36 | last post by:
From what I have read, there isn't really a converter to icon format..it becomes a png file. I tried: 1: Dim bmp As Bitmap = CType(Bitmap.FromFile("C:\myfolder\file.bmp"), Bitmap) 2: ...
3
by: Dennis | last post by:
I have a bitmap and make the color transparent; mybitmap.MakeTransparent(Color.Black) When I save it as a Icon, the black color is not transparent. However, if I save it as a bitmap then...
2
by: jaumef_2000 | last post by:
Hello, I'm developing a Standard Windows App and I need to deal with Icons. I've read lots of posts about them and I'm missing something. I put this code in a button click in a new brand new...
2
by: Dennis | last post by:
I have about 50 images in my application as "embedded resources". They are Icon size (16x16 and 24x24 and 32x32). I can use either the bitmap version or convert them to Icons. Either way seems...
8
by: Frank | last post by:
Given a bitmap I want to write a Icon file using it. I believe I can do it except for writing the bits of the image. Can you tell me how to get the bits into a ByteArray Thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.