|
-
April 1st, 2009, 05:47 AM
#1
Picturebox image transparency
Hi
Controls used : picturebox control,placed a bmp image on it thru image property of picturebox.Made picturebox back color to transparent.(I have taken an arrow image downloaded from net,it has white background)
When we place image on the picturebox control and run the application white background is visible. I doent need the white background it should be transparent.
did with this code also
Bitmap Logo = new Bitmap(this.pboxMain.Image);
Logo.MakeTransparent(Logo.GetPixel(1, 1));
this.pboxMain.Image = (Image)Logo;
pboxMain.Refresh();
but still not working....
help me...
advance thanks
-
April 1st, 2009, 09:51 AM
#2
Re: Picturebox image transparency
Maybe this info can help:
I store transparent PNG images in an ImageList; but my understanding is, the transparent background is automatically converted to white as ImageList can only store bitmaps. So "transparent" = white for my images.
Then I programatically load images from ImageList to a Picture that sits on top of a Panel. The background is white unless I set the BackColor property of the Picture to white and Panel to Transparent, in which case the Picture background is transparent as expected.
Last edited by tr00don; April 1st, 2009 at 09:55 AM.
-
April 2nd, 2009, 01:33 AM
#3
[Resolved] Picturebox image transparency
Hi,
That didnt solved my problem.
I have tried in other way.Took help from one of my friend knowing photoshop to make the image have only arrow.No whitebackground.that made my work.
Thanks
vinni
-
April 4th, 2009, 07:03 AM
#4
Re: Picturebox image transparency
Code:
Bitmap Logo = new Bitmap(this.pboxMain.Image);
Logo.MakeTransparent(Logo.GetPixel(1, 1));
this.pboxMain.Image = (Image)Logo;
i have used such code before and mine worked.
i think yours did not work because the pixel at (1,1) is not purly white.
in ARGB mode pure with is: Color [A=0, R=0, G=0, B=0]
even if you had a value like this: Color [A=0, R=1, G=0, B=0] at pixel (1,1) it is not pure white and it is likly that MakeTransparent have only trasparented that pixel only which is not visible to you unless you ZOOM and enlarge image.
Please rate my post if it was helpful for you.  Java, C#, C++, PHP, ASP.NET
SQL Server, MySQL
DirectX
MATH Touraj Ebrahimi
[toraj_e] [at] [yahoo] [dot] [com]
-
April 4th, 2009, 10:15 PM
#5
Re: Picturebox image transparency
A other way is design your image again.
Example in Yahoo Message, it has many emotions such as ( ) :-? ... so on )
when you use such image, it'll transparent. And you can make your own image like that.
My English is very bad. So tell me if Something I talked make u confuse.
My Ebook Store: www.coding.vn/book.php
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|