473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

GDI defentions.

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#

Nov 17 '05 #1
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#

Nov 17 '05 #2
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#

Nov 17 '05 #3
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#

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.