Click here to Skip to main content
15,915,508 members
Home / Discussions / C#
   

C#

 
QuestionSmooth edge panel and button Pin
VPMahank13-Dec-05 6:16
VPMahank13-Dec-05 6:16 
AnswerRe: Smooth edge panel and button Pin
Robert Rohde13-Dec-05 8:10
Robert Rohde13-Dec-05 8:10 
GeneralRe: Smooth edge panel and button Pin
VPMahank13-Dec-05 8:58
VPMahank13-Dec-05 8:58 
QuestionTransparent Color in Asp .Net C# Pin
Vodstok13-Dec-05 5:46
Vodstok13-Dec-05 5:46 
GeneralRe: Transparent Color in Asp .Net C# Pin
Guffa13-Dec-05 7:27
Guffa13-Dec-05 7:27 
GeneralRe: Transparent Color in Asp .Net C# Pin
Vodstok13-Dec-05 7:30
Vodstok13-Dec-05 7:30 
GeneralRe: Transparent Color in Asp .Net C# Pin
Guffa13-Dec-05 13:08
Guffa13-Dec-05 13:08 
GeneralRe: Transparent Color in Asp .Net C# Pin
Vodstok14-Dec-05 1:48
Vodstok14-Dec-05 1:48 
here is an example of the code for a pretty simple image:

                  Response.ContentType = "image/gif";<br />
<br />
			Bitmap bm = new Bitmap(300,300);<br />
			Graphics gp = Graphics.FromImage(bm);<br />
<br />
			Rectangle re = new Rectangle(0,0,300,300);<br />
			SolidBrush br = new SolidBrush(Color.FromArgb(255,0,0,0));<br />
<br />
			gp.FillRectangle(br,re);<br />
<br />
			<br />
<br />
			SolidBrush br2 = new SolidBrush(Color.Tomato);<br />
			gp.FillEllipse(br2,75,75,150,150);<br />
<br />
			gp.SmoothingMode = SmoothingMode.HighQuality;<br />
			bm.MakeTransparent(Color.FromArgb(255,0,0,0));<br />
			bm.Save(Response.OutputStream, ImageFormat.Gif);<br />
			gp.Dispose();<br />
			bm.Dispose();



this sits in the Page_Load of an aspx page. Notice that the object that is created and output is fundamentally a bitmap (which isnt actually windows specific), but is then output in gif format.

Color.Transparent works just fine for windows forms (win32 apps), but not so great for web graphics.

I have played with some classes others have created for making transparent gifs, but so far they are either terribly messy or hit-or-miss.

______________________
Mr Griffin, eleventy billion is not a number...WTF | :WTF:
AnswerRe: Transparent Color in Asp .Net C# Pin
Guffa18-Dec-05 1:26
Guffa18-Dec-05 1:26 
GeneralRe: Transparent Color in Asp .Net C# Pin
Vodstok19-Dec-05 1:56
Vodstok19-Dec-05 1:56 
Questiontextbox control Pin
John L. DeVito13-Dec-05 5:09
professionalJohn L. DeVito13-Dec-05 5:09 
AnswerRe: textbox control Pin
User 665813-Dec-05 5:29
User 665813-Dec-05 5:29 
AnswerRe: textbox control Pin
Curtis Schlak.13-Dec-05 5:34
Curtis Schlak.13-Dec-05 5:34 
GeneralRe: textbox control Pin
John L. DeVito13-Dec-05 16:38
professionalJohn L. DeVito13-Dec-05 16:38 
GeneralRe: textbox control Pin
Curtis Schlak.14-Dec-05 4:34
Curtis Schlak.14-Dec-05 4:34 
GeneralRe: textbox control Pin
John L. DeVito15-Dec-05 15:16
professionalJohn L. DeVito15-Dec-05 15:16 
GeneralRe: textbox control Pin
TheGreatAndPowerfulOz15-Dec-05 16:49
TheGreatAndPowerfulOz15-Dec-05 16:49 
QuestionHow to pass array of string or doubles between C# and Managed C++ Pin
devinzhang13-Dec-05 5:04
devinzhang13-Dec-05 5:04 
AnswerRe: How to pass array of string or doubles between C# and Managed C++ Pin
Koushik Biswas13-Dec-05 9:47
Koushik Biswas13-Dec-05 9:47 
GeneralRe: How to pass array of string or doubles between C# and Managed C++ Pin
devinzhang13-Dec-05 14:42
devinzhang13-Dec-05 14:42 
QuestionHow to get message from Queue? Pin
Rashid.Mahmood13-Dec-05 4:32
Rashid.Mahmood13-Dec-05 4:32 
AnswerRe: How to get message from Queue? Pin
Judah Gabriel Himango13-Dec-05 4:39
sponsorJudah Gabriel Himango13-Dec-05 4:39 
Answer[Message Deleted] Pin
Judah Gabriel Himango13-Dec-05 4:39
sponsorJudah Gabriel Himango13-Dec-05 4:39 
GeneralRe: How to get message from Queue? Pin
Rashid.Mahmood13-Dec-05 18:33
Rashid.Mahmood13-Dec-05 18:33 
GeneralWebBrowser and Console Applications Pin
S. Senthil Kumar13-Dec-05 4:32
S. Senthil Kumar13-Dec-05 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.