473,387 Members | 1,597 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.

create bitmap with tranparent region

Hi,

i try to create a bitmap with transparent regions, but it does not work.
the transparent region turns out to be black.
anybody some ideas??
Dim bmap As Bitmap(100,100,Imaging.PixelFormat.Format32bppPArg b)
Dim g As Graphics = Graphics.FromImage(bmap)
g.Clear(Color.Transparent)
g.DrawRectangle(New Pen(Color.Blue, 10), New Rectangle(10, 10, 80,80))
g.dispose

'do something with the bitmap....
Nov 21 '05 #1
2 2039
Hi,

Dim bm As New Bitmap(100, 100)

Dim g As Graphics = Graphics.FromImage(bm)

g.FillRectangle(Brushes.Blue, 0, 0, 100, 100)

g.FillRectangle(Brushes.Green, 10, 10, 10, 10)

g.FillEllipse(Brushes.Green, 50, 50, 20, 20)

bm.MakeTransparent(Color.Green)

g.Dispose()

Ken

-----------------------------

"Willie jan" <un*****@unkown.com> wrote in message
news:41***********************@news.euronet.nl...
Hi,

i try to create a bitmap with transparent regions, but it does not work.
the transparent region turns out to be black.
anybody some ideas??
Dim bmap As Bitmap(100,100,Imaging.PixelFormat.Format32bppPArg b)
Dim g As Graphics = Graphics.FromImage(bmap)
g.Clear(Color.Transparent)
g.DrawRectangle(New Pen(Color.Blue, 10), New Rectangle(10, 10, 80,80))
g.dispose

'do something with the bitmap....

Nov 21 '05 #2
thanks.

"Ken Tucker [MVP]" <vb***@bellsouth.net> schreef in bericht
news:uP**************@TK2MSFTNGP14.phx.gbl...
Hi,

Dim bm As New Bitmap(100, 100)

Dim g As Graphics = Graphics.FromImage(bm)

g.FillRectangle(Brushes.Blue, 0, 0, 100, 100)

g.FillRectangle(Brushes.Green, 10, 10, 10, 10)

g.FillEllipse(Brushes.Green, 50, 50, 20, 20)

bm.MakeTransparent(Color.Green)

g.Dispose()

Ken

-----------------------------

"Willie jan" <un*****@unkown.com> wrote in message
news:41***********************@news.euronet.nl...
Hi,

i try to create a bitmap with transparent regions, but it does not work.
the transparent region turns out to be black.
anybody some ideas??
Dim bmap As Bitmap(100,100,Imaging.PixelFormat.Format32bppPArg b)
Dim g As Graphics = Graphics.FromImage(bmap)
g.Clear(Color.Transparent)
g.DrawRectangle(New Pen(Color.Blue, 10), New Rectangle(10, 10, 80,80))
g.dispose

'do something with the bitmap....

Nov 21 '05 #3

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

Similar topics

1
by: André Borchert | last post by:
Hello, how do you select a region (area = x1,y1,x2,y2) of a bitmap and cut or copy this selection into a new bitmap ? The original could be a Bitmap object or a Image/PictureBox object....
0
by: James Dean | last post by:
Question 1:I have my full image and i only display that when the zoom rate is 1:1......i guess i will set my default display to 1:16.....is it okay to just return a thumbnail of the entire image...
0
by: Anonieko Ramos | last post by:
> I have a graphics images that I want to convert to > ASCII art. How do I do it? > Code: - Default.aspx.cs
2
by: Hrvoje Voda | last post by:
What is wrong with this code ? I get message "Attachment.bmp". Bitmap bm = Bitmap.FromFile(@"..\..\Attachment.bmp") as Bitmap; //use the color from 0,0 as tranparent
0
by: Balu Ramachandran | last post by:
How can I create the Thumbnail view from the form? In the following approach I tried but Iams facing some limitations to get the thumbnail image of the form alone. Plaese any one can help in...
3
by: news | last post by:
Hi Guys, Sorry if this is an obvious question but Im trying to rotate a bitmap and then save it. So far Ive only found how to rotates a Graphic but I can't find how to save it. I also want to...
3
by: Richard Skopal | last post by:
In .NET Windows forms I can create a metafile using this code: Graphics grph = aControl.CreateGraphics(); IntPtr ipHDC = grph.GetHdc(); Metafile mf = new Metafile(aImgFilePath, ipHDC,...
2
by: Peter Proost | last post by:
Hi group I have the following piece of code that should resize the bitmap in a picture box but it doesn't work as I tought it would. Can someone help me with it? thnx Peter Public Class...
4
by: VBTricks.de.vu Webmaster | last post by:
Hello, I have an bitmap in a resources file containing all icons displayed in the toolbar. To display the icons I need to cut them out of the bitmap and add them to an imagelist. The problem is...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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.