This function draw rectangles which grow from up toward down.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics dc = e.Graphics;
Pen BluePen = new Pen(Color.Blue, 4);
dc.DrawRectangle(BluePen, 100, 250, 50, answer1Result*2);
dc.DrawRectangle(BluePen, 250, 250, 50, answer2Result*2);
dc.DrawRectangle(BluePen, 400, 250, 50, answer3Result*2);
}
How can I cause it to behave the up side-down way, means grow from
bottom up?
TIA,
sea# 3 1108
I don´t know the answer, but I noticed that you are not disposing the
graphic objects that you create, such as BluePen. When you are done with the
drawing, you should dispose them.
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers: http://www.mztools.com
"sea#" <ro****@tauex.tau.ac.il> escribió en el mensaje
news:11*********************@g43g2000cwa.googlegro ups.com... This function draw rectangles which grow from up toward down. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics dc = e.Graphics; Pen BluePen = new Pen(Color.Blue, 4);
dc.DrawRectangle(BluePen, 100, 250, 50, answer1Result*2); dc.DrawRectangle(BluePen, 250, 250, 50, answer2Result*2); dc.DrawRectangle(BluePen, 400, 250, 50, answer3Result*2);
} How can I cause it to behave the up side-down way, means grow from bottom up?
TIA,
sea#
sea#,
Are you saying you want to have an animation effect where you can see
the rectangles being drawn? If so, you will have to set up a timer which
will cause the image to invalidate every few milliseconds (depending on how
fast and smooth you want the animation to occur). Then you would have to
override your paint method to draw the rectangles in the appropriate state.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"sea#" <ro****@tauex.tau.ac.il> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com... This function draw rectangles which grow from up toward down. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics dc = e.Graphics; Pen BluePen = new Pen(Color.Blue, 4);
dc.DrawRectangle(BluePen, 100, 250, 50, answer1Result*2); dc.DrawRectangle(BluePen, 250, 250, 50, answer2Result*2); dc.DrawRectangle(BluePen, 400, 250, 50, answer3Result*2);
} How can I cause it to behave the up side-down way, means grow from bottom up?
TIA,
sea#
See the Windows Forms Tips and Tricks animation article.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"sea#" <ro****@tauex.tau.ac.il> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com... This function draw rectangles which grow from up toward down. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics dc = e.Graphics; Pen BluePen = new Pen(Color.Blue, 4);
dc.DrawRectangle(BluePen, 100, 250, 50, answer1Result*2); dc.DrawRectangle(BluePen, 250, 250, 50, answer2Result*2); dc.DrawRectangle(BluePen, 400, 250, 50, answer3Result*2);
} How can I cause it to behave the up side-down way, means grow from bottom up?
TIA,
sea# This thread has been closed and replies have been disabled. Please start a new discussion. |