GDI defentions.

  • Thread starter Thread starter sea#
  • Start date Start date
S

sea#

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#
 
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#,

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.
 
Back
Top