Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: face recognition Pin
Le centriste26-Jan-06 3:57
Le centriste26-Jan-06 3:57 
GeneralRe: face recognition Pin
maf3os26-Jan-06 14:18
maf3os26-Jan-06 14:18 
QuestionIterate through object properties Pin
Leo Smith25-Jan-06 11:39
Leo Smith25-Jan-06 11:39 
AnswerRe: Iterate through object properties Pin
[Marc]25-Jan-06 12:15
[Marc]25-Jan-06 12:15 
GeneralRe: Iterate through object properties Pin
Leo Smith25-Jan-06 15:51
Leo Smith25-Jan-06 15:51 
QuestionGraphics.DrawImage - why it's so slow? Pin
Libor Tinka25-Jan-06 11:26
Libor Tinka25-Jan-06 11:26 
AnswerRe: Graphics.DrawImage - why it's so slow? Pin
[Marc]25-Jan-06 12:13
[Marc]25-Jan-06 12:13 
AnswerRe: Graphics.DrawImage - why it's so slow? Pin
Dave Kreskowiak25-Jan-06 16:11
mveDave Kreskowiak25-Jan-06 16:11 
In addition to what Marc said...

Instead of redrawing the image from the same 7M pixel image (huge!), have your control draw the thumbnail image to an internal buffer first, the same size as the preview window. Then when your preview has to draw, it can more quickly draw it from the internal buffer version, which should be pretty small.

I've had to do this a few times in some custom controls that I wrote. Instead of calculating the same image over and over again in order to redraw a control image that doesn't change much, I monitor the Resize events of my control and redraw the control image to an internal buffer. Then in the Paint event for the control, I draw the control image from the buffer.

For example, take a clock face. Most of what you see doesn't change, except for the hand positions. But, to get smoothly turning clock hands, you have to redraw the control about every 30-50 ms at least. Since calculating the positions of the various bits of a clock face can be time consuming, a clock face image should be calculated and drawn once to a cached image. When the control has to redraw itself (every 30ms), it merely has to draw the clock face from the cache, then calculate and draw only the hand positions. When the size of the control changes, you recalculate and redraw the cache image to match the size of the control.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Graphics.DrawImage - why it's so slow? Pin
Libor Tinka26-Jan-06 2:05
Libor Tinka26-Jan-06 2:05 
GeneralRe: Graphics.DrawImage - why it's so slow? Pin
Dan Neely26-Jan-06 3:34
Dan Neely26-Jan-06 3:34 
Questionrunning out of PTEs Pin
Mark Hahn CA25-Jan-06 9:14
Mark Hahn CA25-Jan-06 9:14 
AnswerRe: running out of PTEs Pin
Dave Kreskowiak25-Jan-06 15:59
mveDave Kreskowiak25-Jan-06 15:59 
GeneralRe: running out of PTEs Pin
Mark Hahn CA26-Jan-06 8:05
Mark Hahn CA26-Jan-06 8:05 
GeneralRe: running out of PTEs Pin
Dave Kreskowiak26-Jan-06 14:37
mveDave Kreskowiak26-Jan-06 14:37 
QuestionHow to get valid IPs from an IP Range? Pin
bigmacrox25-Jan-06 8:45
bigmacrox25-Jan-06 8:45 
AnswerRe: How to get valid IPs from an IP Range? Pin
tylerl25-Jan-06 9:05
tylerl25-Jan-06 9:05 
GeneralRe: How to get valid IPs from an IP Range? Pin
bigmacrox25-Jan-06 9:17
bigmacrox25-Jan-06 9:17 
GeneralRe: How to get valid IPs from an IP Range? Pin
Mike Dimmick25-Jan-06 10:42
Mike Dimmick25-Jan-06 10:42 
Questiontuples Pin
JoeSox25-Jan-06 7:17
JoeSox25-Jan-06 7:17 
AnswerRe: tuples Pin
User 665825-Jan-06 8:03
User 665825-Jan-06 8:03 
GeneralRe: tuples Pin
JoeSox25-Jan-06 8:10
JoeSox25-Jan-06 8:10 
GeneralRe: tuples Pin
User 665825-Jan-06 8:18
User 665825-Jan-06 8:18 
GeneralRe: tuples Pin
JoeSox25-Jan-06 8:28
JoeSox25-Jan-06 8:28 
AnswerRe: tuples Pin
Kevin McFarlane25-Jan-06 12:37
Kevin McFarlane25-Jan-06 12:37 
GeneralRe: tuples Pin
JoeSox25-Jan-06 12:53
JoeSox25-Jan-06 12:53 

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.