Click here to Skip to main content
15,899,825 members
Home / Discussions / Graphics
   

Graphics

 
Questionstereo picture Pin
sarkuzi14-Jun-09 6:40
sarkuzi14-Jun-09 6:40 
AnswerRe: stereo picture Pin
Henry Minute16-Jun-09 11:26
Henry Minute16-Jun-09 11:26 
GeneralRe: stereo picture Pin
Luc Pattyn16-Jun-09 12:52
sitebuilderLuc Pattyn16-Jun-09 12:52 
QuestionUSB WEBCAMs Pin
sarkuzi14-Jun-09 6:33
sarkuzi14-Jun-09 6:33 
AnswerRe: USB WEBCAMs Pin
MikeMarq16-Jun-09 9:08
MikeMarq16-Jun-09 9:08 
AnswerRe: USB WEBCAMs Pin
jon-martin.com21-Jul-09 2:17
jon-martin.com21-Jul-09 2:17 
QuestionMetal Circle with GDI+ Pin
Leslie Sanford10-Jun-09 19:42
Leslie Sanford10-Jun-09 19:42 
AnswerRe: Metal Circle with GDI+ Pin
Luc Pattyn11-Jun-09 6:25
sitebuilderLuc Pattyn11-Jun-09 6:25 
Hi Leslie,

I am not very familiar with gradient brushes, and didn't manage to get an angular one; all I tried resulted in radial gradients. So I tried it without gradients, and came up with a square cosine function; try the following in the Paint handler of some Control, say a Panel:

Graphics g=e.Graphics;
int cx=pan.Width/2;
int cy=pan.Height/2;
int r=cx;
if (r>cy) r=cy;
r-=20;  // margin
int t=cx/64;
if (t<2) t=2;
g.TranslateTransform(cx, cy);
int darkest=80;
int lightest=255;
for (int i=0; i<=90; i+=1) {
    double cos=Math.Cos(i*Math.PI/180);
    int c=darkest+(int)((lightest-darkest)*cos*cos);
    Brush brush=new SolidBrush(Color.FromArgb(c,c,c));
    int j=i+45;
    g.RotateTransform(j);
    g.FillRectangle(brush, -r, -t, 2*r, 2*t);
    g.RotateTransform(-j);
    j=225-i;
    g.RotateTransform(j);
    g.FillRectangle(brush, -r, -t, 2*r, 2*t);
    g.RotateTransform(-j);
    brush.Dispose();
}


BTW: the code is rather expensive, however you could turn the result into a bitmap and use that.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Metal Circle with GDI+ Pin
Leslie Sanford11-Jun-09 10:14
Leslie Sanford11-Jun-09 10:14 
GeneralRe: Metal Circle with GDI+ Pin
Luc Pattyn11-Jun-09 10:19
sitebuilderLuc Pattyn11-Jun-09 10:19 
GeneralRe: Metal Circle with GDI+ Pin
Luc Pattyn12-Jun-09 3:42
sitebuilderLuc Pattyn12-Jun-09 3:42 
GeneralRe: Metal Circle with GDI+ Pin
Leslie Sanford13-Jun-09 8:41
Leslie Sanford13-Jun-09 8:41 
GeneralRe: Metal Circle with GDI+ Pin
Luc Pattyn14-Jun-09 7:25
sitebuilderLuc Pattyn14-Jun-09 7:25 
GeneralRe: Metal Circle with GDI+ Pin
Leslie Sanford23-Jun-09 14:27
Leslie Sanford23-Jun-09 14:27 
GeneralRe: Metal Circle with GDI+ Pin
Luc Pattyn23-Jun-09 14:33
sitebuilderLuc Pattyn23-Jun-09 14:33 
GeneralRe: Metal Circle with GDI+ Pin
Luc Pattyn26-Jun-09 6:48
sitebuilderLuc Pattyn26-Jun-09 6:48 
GeneralRe: Metal Circle with GDI+ Pin
Henry Minute16-Jun-09 11:12
Henry Minute16-Jun-09 11:12 
QuestionWeb Cam URL Pin
Dinker Batra9-Jun-09 21:15
Dinker Batra9-Jun-09 21:15 
Questionhow can I load a image into memory? Pin
transoft8-Jun-09 4:38
transoft8-Jun-09 4:38 
QuestionCreating an Emboss/Bevelled effect for Circles and Rectangles [modified] Pin
Leslie Sanford7-Jun-09 19:56
Leslie Sanford7-Jun-09 19:56 
AnswerRe: Creating an Emboss/Bevelled effect for Circles and Rectangles Pin
Tim Craig8-Jun-09 14:38
Tim Craig8-Jun-09 14:38 
GeneralRe: Creating an Emboss/Bevelled effect for Circles and Rectangles Pin
Leslie Sanford8-Jun-09 15:37
Leslie Sanford8-Jun-09 15:37 
GeneralRe: Creating an Emboss/Bevelled effect for Circles and Rectangles Pin
Tim Craig8-Jun-09 19:09
Tim Craig8-Jun-09 19:09 
GeneralRe: Creating an Emboss/Bevelled effect for Circles and Rectangles Pin
Leslie Sanford8-Jun-09 19:52
Leslie Sanford8-Jun-09 19:52 
GeneralRe: Creating an Emboss/Bevelled effect for Circles and Rectangles Pin
Tim Craig9-Jun-09 15:05
Tim Craig9-Jun-09 15:05 

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.