|
-
Mar 11th, 2007, 09:43 PM
#1
Thread Starter
Addicted Member
[2005] GDI+ question, Image VS Graphics object
If I want to draw an object that have to update frequently, should I use an image and update it's location, or I draw it with GDI+ ? Which one you would recommend and why?
Let me give you an example.
Suppose I want to make an analog clock. However, I don't want to just use lines. To make it more complex and nicer, I want to use a rectangle for it arms. A perfect example for this case is Clock from windows sidebar on Vista.
I will divine into 2 parts, background and it's arm. The main reason for this problem, is performance. Imagine that you have a form which display multiple analog clock displaying time in several countries.
So, here's the question:
1. For background: Should I use a fixed background (with an image), or drawing with GDI+ ?
2. For it arms. Should I use an image and update it's location periodically, or draw them completely with GDI+ ?
For those questions, please tell me your opinion about what shoud I use and why.
Regards
Michael
-
Mar 12th, 2007, 12:00 AM
#2
Re: [2005] GDI+ question, Image VS Graphics object
You should use a PictureBox for the face and GDI+ to draw the hands. Performance is not an issue with the face and using a PictureBox is easier. Using GDI+ for the hands is both simpler and better performing.
-
Mar 12th, 2007, 06:27 AM
#3
Re: [2005] GDI+ question, Image VS Graphics object
 Originally Posted by michaelrawi
If I want to draw an object that have to update frequently, should I use an image and update it's location, or I draw it with GDI+ ? Which one you would recommend and why?
Let me give you an example.
Suppose I want to make an analog clock. However, I don't want to just use lines. To make it more complex and nicer, I want to use a rectangle for it arms. A perfect example for this case is Clock from windows sidebar on Vista.
I will divine into 2 parts, background and it's arm. The main reason for this problem, is performance. Imagine that you have a form which display multiple analog clock displaying time in several countries.
So, here's the question:
1. For background: Should I use a fixed background (with an image), or drawing with GDI+ ?
2. For it arms. Should I use an image and update it's location periodically, or draw them completely with GDI+ ?
For those questions, please tell me your opinion about what shoud I use and why.
Regards
Michael
Hi,
Here's an example how to draw an Analog Clock.
http://www.codeproject.com/vb/net/analogclock.asp
Wkr,
sparrow1
-
Mar 12th, 2007, 09:01 PM
#4
Thread Starter
Addicted Member
Re: [2005] GDI+ question, Image VS Graphics object
Thanks for the replies.
Well, actually I didn't want to create an analog clock. I just want to know about the concept using fully GDI+ code or combine GDI+ with fixed image. I want to know which is better.
@sparrow1: thanks for the code. I'll look on to it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|