|
-
Jan 5th, 2003, 04:56 AM
#1
Thread Starter
New Member
Transparent BMP's
Is it possible to change the alpha colour on a transparent BMP, in VB .NET?
The reason is, when I load a transparent image, and store it in an image list with transparency, and then save that image from there, it gives it a black background… which is not what I want.
-
Jan 5th, 2003, 11:29 PM
#2
yay gay
i have the feeling BMP format doesnt support transparency...i think u are talking about WMF or PNG or GIF right?
\m/  \m/
-
Jan 5th, 2003, 11:31 PM
#3
Thread Starter
New Member
Scan the image for transparent pixels, and convert them to a colour.
Code:
Dim x As Integer, y As Integer
For x = 0 To Img.Width - 1
For y = 0 To Img.Height - 1
If Img.GetPixel(x, y).ToArgb = 0 Then Img.SetPixel(x, y, Color.FromArgb(0, 0, 255, 0))
Next
Next
-
Jan 5th, 2003, 11:35 PM
#4
Thread Starter
New Member
If you load a BMP into a picture box, or image list, etc, it does support transparency. However, when you save it to disk, the transparent layer is issued a colour – I don’t know how and why it works like this… it just does. My solution is above.
-
Jan 6th, 2003, 02:21 AM
#5
Originally posted by guiledotNET
Scan the image for transparent pixels, and convert them to a colour.
Code:
Dim x As Integer, y As Integer
For x = 0 To Img.Width - 1
For y = 0 To Img.Height - 1
If Img.GetPixel(x, y).ToArgb = 0 Then Img.SetPixel(x, y, Color.FromArgb(0, 0, 255, 0))
Next
Next
that would be quite inefficient dont have my book with me now, otherwise I would post something better ...
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 6th, 2003, 02:25 AM
#6
Thread Starter
New Member
If you are able to, later, I would appreciate it.
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
|