Click here to Skip to main content
15,909,827 members
Home / Discussions / C#
   

C#

 
GeneralRe: application uses all the memory Pin
Heath Stewart18-Feb-04 3:55
protectorHeath Stewart18-Feb-04 3:55 
Generalclosing the main form after loading another form Pin
killermoses16-Feb-04 19:31
killermoses16-Feb-04 19:31 
GeneralRe: closing the main form after loading another form Pin
John Kuhn16-Feb-04 19:38
John Kuhn16-Feb-04 19:38 
GeneralRe: closing the main form after loading another form Pin
obelisk2916-Feb-04 19:48
obelisk2916-Feb-04 19:48 
GeneralRe: closing the main form after loading another form Pin
killermoses17-Feb-04 2:02
killermoses17-Feb-04 2:02 
GeneralRe: closing the main form after loading another form Pin
Heath Stewart17-Feb-04 5:26
protectorHeath Stewart17-Feb-04 5:26 
GeneralRe: closing the main form after loading another form Pin
Charlie Williams17-Feb-04 4:19
Charlie Williams17-Feb-04 4:19 
GeneralCalling Managed C++ code in a C# App Pin
granderson16-Feb-04 12:28
granderson16-Feb-04 12:28 
GeneralRe: Calling Managed C++ code in a C# App Pin
obelisk2916-Feb-04 19:41
obelisk2916-Feb-04 19:41 
GeneralMetrics 2 english 2 twips 2 whatever Pin
Tomaž Štih16-Feb-04 11:58
Tomaž Štih16-Feb-04 11:58 
GeneralRe: Metrics 2 english 2 twips 2 whatever Pin
Heath Stewart17-Feb-04 3:52
protectorHeath Stewart17-Feb-04 3:52 
GeneralPrinting from a webservice Pin
nathanreynolds16-Feb-04 11:31
nathanreynolds16-Feb-04 11:31 
GeneralRe: Printing from a webservice Pin
Heath Stewart17-Feb-04 3:26
protectorHeath Stewart17-Feb-04 3:26 
GeneralRe: Printing from a webservice Pin
nathanreynolds17-Feb-04 10:55
nathanreynolds17-Feb-04 10:55 
GeneralRe: Printing from a webservice Pin
Heath Stewart17-Feb-04 13:13
protectorHeath Stewart17-Feb-04 13:13 
GeneralRe: Printing from a webservice Pin
nathanreynolds17-Feb-04 16:27
nathanreynolds17-Feb-04 16:27 
GeneralRe: Printing from a webservice Pin
Heath Stewart17-Feb-04 19:32
protectorHeath Stewart17-Feb-04 19:32 
GeneralRe: Printing from a webservice Pin
nathanreynolds18-Feb-04 2:27
nathanreynolds18-Feb-04 2:27 
GeneralRe: Printing from a webservice Pin
Heath Stewart18-Feb-04 4:11
protectorHeath Stewart18-Feb-04 4:11 
GeneralA GDI+ newbie problem Pin
cemlouis16-Feb-04 11:28
cemlouis16-Feb-04 11:28 
GeneralRe: A GDI+ newbie problem Pin
Charlie Williams16-Feb-04 16:14
Charlie Williams16-Feb-04 16:14 
GeneralRe: A GDI+ newbie problem Pin
cemlouis17-Feb-04 3:50
cemlouis17-Feb-04 3:50 
GeneralFill 50% of a drawing with a color Pin
r916-Feb-04 9:32
r916-Feb-04 9:32 
Hi.

Can someone show me how to fill 50% of the below drawing with a solid color.
From buttom to top.

Thanks
Regards r9


The drawing:

private System.Drawing.Graphics graphicsObj = null;
private System.Drawing.Pen penBlackWidth1 = new System.Drawing.Pen(System.Drawing.Color.Black,1);
private Point[] curvePoints = null;
private SolidBrush lightGrayBrush = new SolidBrush(Color.LightGray);
private Point point1;
private Point point2;
private Point point3;
private Point point4;
private SolidBrush blackBrush = new SolidBrush(Color.Black);
...................................................

try
{

graphicsObj = e.Graphics;

graphicsObj.DrawLine(penBlackWidth1, 45, 20, 175, 20);
graphicsObj.DrawLine(penBlackWidth1, 45, 20, 45, 120);
graphicsObj.DrawLine(penBlackWidth1, 175, 20, 175, 120);

graphicsObj.DrawLine(penBlackWidth1, 45,120,90,160);
graphicsObj.DrawLine(penBlackWidth1, 175, 120, 135, 160);
graphicsObj.DrawLine(penBlackWidth1, 90, 160, 135, 160);

graphicsObj.DrawLine(penBlackWidth1, 465, 335, 490, 335);
graphicsObj.DrawLine(penBlackWidth1, 580, 335, 605, 335);

graphicsObj.DrawLine(penBlackWidth1, 465, 335, 490, 335);
graphicsObj.DrawLine(penBlackWidth1, 580, 335, 605, 335);

graphicsObj.DrawLine(penBlackWidth1, 473, 345, 483, 345);
graphicsObj.DrawLine(penBlackWidth1, 473, 345, 478, 335);
graphicsObj.DrawLine(penBlackWidth1, 483, 345, 478, 335);

graphicsObj.DrawLine(penBlackWidth1, 587, 345, 597, 345);
graphicsObj.DrawLine(penBlackWidth1, 587, 345, 592, 335);
graphicsObj.DrawLine(penBlackWidth1, 597, 345, 592, 335);

point1 = new Point(592,335);
point2 = new Point(597,345);
point3 = new Point(587,345);
point4 = new Point(592,335);

curvePoints = new Point[]
{
point1,point2, point3, point4
};

graphicsObj.FillPolygon(blackBrush, curvePoints, FillMode.Alternate);

point1 = new Point(478,335);
point2 = new Point(483,345);
point3 = new Point(473,345);
point4 = new Point(478,335);

curvePoints = new Point[]
{
point1,point2, point3, point4
};

graphicsObj.FillPolygon(blackBrush, curvePoints, FillMode.Alternate);
}
catch (Exception ex)
{

MessageBox.Show(ex.Message);
}




GeneralRe: Fill 50% of a drawing with a color Pin
Heath Stewart16-Feb-04 9:45
protectorHeath Stewart16-Feb-04 9:45 
GeneralRe: Fill 50% of a drawing with a color Pin
r916-Feb-04 9:48
r916-Feb-04 9:48 

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.