473,327 Members | 1,952 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,327 software developers and data experts.

transparent image in memory

How would I create a 1x1 pixel transparent gif in memory? I don't want to
load it from an existing file.

Thanks,
Todd
Nov 21 '05 #1
2 1406
hi Todd
Check out these threads hope they help

http://www.experts-exchange.com/Web/..._20987728.html

http://weblogs.asp.net/jrule/archive...16/215393.aspx

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 21 '05 #2
Nak
Hi there,

For some strange reason I could not get the Framework to save a GIF with
transparency,but unforatunely the GIF encoder does not have any setable
parameters so I couldn't do much more. (FW 1.0)

I could on the other hand save the picture as a PNG with transparency.
Making a bitmap object is a piece of cake,

Dim pop As New Bitmap(1, 1, Imaging.PixelFormat.Format32bppArgb)
Call pop.Save("c:\pop.png", Imaging.ImageFormat.Png)

The above will make a 1 x 1 bitmap with an alpha channel, the default
colour appears to be alpha already so there is no need to set it, but if you
want to make a pixel completely transparent do the following

Call pop.SetPixel(0, 0, Color.FromArgb(0, 0, 0, 0))

The first value (Alpha) ranges from 0 (Transparent) to 1 (Opaque). I
hope that this helps!

Nick.

"Todd H" <Todd H@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.com...
How would I create a 1x1 pixel transparent gif in memory? I don't want to
load it from an existing file.

Thanks,
Todd

Nov 21 '05 #3

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

Similar topics

2
by: Fearless Freep | last post by:
I know there's a PIL mailing list but I thought I would try the question here as well. I'm using PIL on Python 1.5.2 (stop laughing, it's what the ISP has for CGI and I don't have a choice) ...
4
by: R.Marquez | last post by:
I am trying to create a simple script that Opens an existing PNG and resaves it with a transparent color. With the command line version of ImageMagic this is an easy endevor (and my current...
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
1
by: Chris Auer | last post by:
I have been banging my head for a couple of hours now. No matter what I do the color that I make transparent is black. Here is the code I am using from MSDN. I have tried bitmaps, jpegs, gifs and...
2
by: Raj | last post by:
Hi, Anyone has any idea as to how we can make a button or any standard windows control as transparent or semi-trnasparent. How can we do this in C#? Thanks, Rajendra
4
by: Dale | last post by:
I am creating GIF images with transparent backgrounds on-the-fly for a web app and rendering them by using System.Drawing.Image.Save(Response.OutputStream, ImageType.GIF). I am confident that...
9
by: Chuck Anderson | last post by:
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of...
0
by: MasterOfTheDark | last post by:
This one's a hairy one to explain. What I've got is a class called "VistaGroupBox" that I put some nice-looking Vista-style gradients in the background and made to look like the ribbon categories...
0
by: abc123456 | last post by:
Hello - I'm using imagecopyresample() to resize a GIF line-art type image onto a polygon created with GD_Image in PHP. Each has a transparent color (same color, I think!). The transparent color...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.