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

Question about fetching a GIF image from assembly

I use reflection to get a GIF image that contains a transparency
mask (the white background should be transparent) that is
part of my C# project build. The problem is that the image's
transparency property disappears when I render it making
it look as if were a JPEG image.

The code I use is:

Assembly assem = this.GetType().Assembly;
Stream streamTransPic =
assem.GetManifestResourceStream("MyProject.images. transPic.gif");
transPic = System.Drawing.Image.FromStream(streamTransPic);

It is rendered with Graphics.DrawImage method in

gObj.DrawImage (transPic, rect);

where gObj is an instance of Graphics and rect has already been
defined.

If I read the image from a file rather than storing it in the compiled
assembly, its GIF transparency property is present when I render
it. But I don't want to use separate data files with production code.


Jul 15 '06 #1
1 1636

"JimC" <ji**@nospam.plswrote in message
news:XB********************@newssvr13.news.prodigy .com...
>I use reflection to get a GIF image that contains a transparency
mask (the white background should be transparent) that is
part of my C# project build. The problem is that the image's
transparency property disappears when I render it making
it look as if were a JPEG image.

The code I use is:

Assembly assem = this.GetType().Assembly;
Stream streamTransPic =
assem.GetManifestResourceStream("MyProject.images. transPic.gif");
transPic = System.Drawing.Image.FromStream(streamTransPic);

It is rendered with Graphics.DrawImage method in

gObj.DrawImage (transPic, rect);

where gObj is an instance of Graphics and rect has already been
defined.

If I read the image from a file rather than storing it in the compiled
assembly, its GIF transparency property is present when I render
it. But I don't want to use separate data files with production code.
Sorry. Let's cancel this question. I discovered that I had stored a
GIF image which didn't have the transparency mask present. When I
replaced it and recompiled, everything worked the way it should
for a GIF image.


Jul 15 '06 #2

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

Similar topics

0
by: Andres Baravalle | last post by:
Hi, I have a problem using a URL fetching algorithm (HTTP 1.0). To download an image, I used to use this algorithm: <?php Header("Content-type: image/gif"); $referer =...
11
by: Sheila Jones | last post by:
Hello, I posted this as a follow-on question yesterday, but nobody has bitten: Is a .Net application recompiled (i.e. from CIL to native code) each time it is run? Or is the native code...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
1
by: Robin Tucker | last post by:
Hi there, I have a "worker thread", which can perform one of many tasks, including fetching and sending data blobs to a database, load files etc. Now, a progress dialog is displayed while the...
0
by: gs | last post by:
in teh log for vb build, what does the following mean and what should I do about them? LOG: Bind to native image succeeded. Native image has correct version information. Attempting to use native...
0
by: ChopStickr | last post by:
I have a custom control that is embedded (using the object tag) in an html document. The control takes a path to a local client ini file. Reads the file. Executes the program specified in...
5
by: Bhavesh | last post by:
Hello genious people, I m trying to insert a LARGE text from Multiline Textbox into my table of sqlserver2000. I m using vs-2005. Please note that I dont want to store blob data From FILE...
1
by: Bhavesh | last post by:
Hi Bruce, Thanks For Reply. U were right, Needed to pass string , but also need to pass size of Data( instead of 16, passed actual length of data). So that worked for me & didn't get any...
0
by: punitshrivastava | last post by:
Hi to All Senior's, I am working in Asp.net with C#. I am newbie in C#. So i want to fetch mutiple images from database .Database i am using is Sql Server. For this i code: //get the image id...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.