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

C#

 
GeneralRe: C# library Pin
mike montagne22-Feb-07 10:08
mike montagne22-Feb-07 10:08 
GeneralRe: C# library Pin
mike montagne22-Feb-07 10:10
mike montagne22-Feb-07 10:10 
GeneralRe: C# library Pin
mike montagne22-Feb-07 10:16
mike montagne22-Feb-07 10:16 
QuestionHow to change back color of Tab Control? Pin
vivek_pawar22-Feb-07 1:54
vivek_pawar22-Feb-07 1:54 
AnswerRe: How to change back color of Tab Control? Pin
Judah Gabriel Himango22-Feb-07 5:00
sponsorJudah Gabriel Himango22-Feb-07 5:00 
GeneralWonderful Pin
raja sekhara reddy p22-Feb-07 1:39
raja sekhara reddy p22-Feb-07 1:39 
GeneralRe: Wonderful Pin
Pete O'Hanlon22-Feb-07 2:07
mvePete O'Hanlon22-Feb-07 2:07 
QuestionCreate transparent gradient form? Pin
BlueChippy22-Feb-07 0:55
BlueChippy22-Feb-07 0:55 
Is it possible to create a Form which fades from a colour to transparent?

I thought the code below would work to create a round form which fades from a colour through to transparent - but it actually fades to the colour of the transparency key?

This works perfectly to fade from one color to another and gives a nice round form...but the alpha value dosen't appear to be doing what I expected. I've tried various values for the colour but none of them give what I was expecting Confused | :confused:

Thanks


OnPaint
base.OnPaint(e);<br />
<br />
Graphics g = e.Graphics;<br />
<br />
g.SmoothingMode = SmoothingMode.AntiAlias;<br />
Rectangle rect = new Rectangle(1, 1, this.Width - 1, this.Height - 1);<br />
Rectangle rect2 = new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 1, rect.Height - 1);<br />
<br />
GraphicsPath myPath = new GraphicsPath();<br />
myPath.AddEllipse(rect2);<br />
PathGradientBrush brush2 = new PathGradientBrush(myPath);<br />
brush2.CenterColor = Color.LightSteelBlue;<br />
brush2.CenterPoint = new Point(rect2.X + 75, rect2.Y + 75);<br />
<br />
Color myColor = Color.FromArgb(25, this.TransparencyKey);<br />
Color[] colors = { myColor};<br />
brush2.SurroundColors = colors;<br />
g.FillEllipse(brush2, rect2);<br />
<br />
g.SmoothingMode = SmoothingMode.Default;<br />
Brush linBrush = new LinearGradientBrush(rect, Color.DarkGoldenrod, Color.LightGoldenrodYellow, LinearGradientMode.ForwardDiagonal);<br />
Pen myPen = new Pen(linBrush, 3f);<br />
g.DrawEllipse(myPen, rect); 


(I added the border elipse just for clarity)
AnswerRe: Create transparent gradient form? Pin
Judah Gabriel Himango22-Feb-07 4:56
sponsorJudah Gabriel Himango22-Feb-07 4:56 
GeneralRe: Create transparent gradient form? Pin
mike montagne22-Feb-07 8:51
mike montagne22-Feb-07 8:51 
GeneralRe: Create transparent gradient form? Pin
mike montagne22-Feb-07 9:28
mike montagne22-Feb-07 9:28 
AnswerRe: Create transparent gradient form? Pin
mike montagne22-Feb-07 9:01
mike montagne22-Feb-07 9:01 
GeneralRe: Create transparent gradient form? Pin
mike montagne22-Feb-07 9:32
mike montagne22-Feb-07 9:32 
AnswerRe: Create transparent gradient form? Pin
mike montagne22-Feb-07 9:12
mike montagne22-Feb-07 9:12 
GeneralRe: Create transparent gradient form? Pin
BlueChippy22-Feb-07 21:05
BlueChippy22-Feb-07 21:05 
QuestionSystem.Net.Mail response Pin
babbelfisken22-Feb-07 0:55
babbelfisken22-Feb-07 0:55 
AnswerRe: System.Net.Mail response Pin
Mike Dimmick22-Feb-07 1:01
Mike Dimmick22-Feb-07 1:01 
GeneralRe: System.Net.Mail response Pin
babbelfisken22-Feb-07 1:18
babbelfisken22-Feb-07 1:18 
QuestionCreate and set Printer port? Pin
Sebastian P.R. Gingter22-Feb-07 0:42
Sebastian P.R. Gingter22-Feb-07 0:42 
QuestionClient-Server Problem Pin
stancrm22-Feb-07 0:31
stancrm22-Feb-07 0:31 
AnswerRe: Client-Server Problem Pin
Mike Dimmick22-Feb-07 0:57
Mike Dimmick22-Feb-07 0:57 
Questionsynchronisation Pin
Sunshine Always22-Feb-07 0:16
Sunshine Always22-Feb-07 0:16 
AnswerRe: synchronisation Pin
Judah Gabriel Himango22-Feb-07 4:52
sponsorJudah Gabriel Himango22-Feb-07 4:52 
Questionconversion problem VS 2003 to VS 2005 Pin
ArthurGZ21-Feb-07 23:48
ArthurGZ21-Feb-07 23:48 
AnswerRe: conversion problem VS 2003 to VS 2005 Pin
Stefan Troschuetz22-Feb-07 0:02
Stefan Troschuetz22-Feb-07 0:02 

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.