Click here to Skip to main content
15,921,169 members
Home / Discussions / C#
   

C#

 
GeneralRe: a way to access to all object on the form Pin
Corinna John30-Aug-04 20:32
Corinna John30-Aug-04 20:32 
Question"Shutting down a remote PC? Pin
Salman Taseer`30-Aug-04 18:48
Salman Taseer`30-Aug-04 18:48 
AnswerRe: "Shutting down a remote PC? Pin
Lim Bio Liong30-Aug-04 19:51
Lim Bio Liong30-Aug-04 19:51 
AnswerRe: "Shutting down a remote PC? Pin
Dave Kreskowiak31-Aug-04 5:53
mveDave Kreskowiak31-Aug-04 5:53 
GeneralRe: "Shutting down a remote PC? Pin
Salman Taseer`31-Aug-04 7:13
Salman Taseer`31-Aug-04 7:13 
GeneralPreserving what is drawn to Controls Pin
Member 94235530-Aug-04 15:05
Member 94235530-Aug-04 15:05 
GeneralRe: Preserving what is drawn to Controls Pin
Christian Graus30-Aug-04 15:09
protectorChristian Graus30-Aug-04 15:09 
GeneralRe: Preserving what is drawn to Controls Pin
Joel Lucsy30-Aug-04 17:02
Joel Lucsy30-Aug-04 17:02 
Well, to address your last questions, yes, OnPaint should already have a an update rectangle (knowledge derived from WM_PAINT, don't know the equivalent .NET property, my help is at work). Then you only need to refresh that rectangle.
In more general terms, as already stated, storing a bitmap of your area is a common technique. Then all you have to do for a OnPaint is blit the bitmap to the screen. Of course, you still need to generate this bitmap when ever the user does something.
Another idea is use Windows Metafiles. (Again, since I don't have my docs, I'm speaking about win32). Creating a metafile will give you a HDC, which you then paint on top of. Then you can "replay" then metafile to any other HDC (screen, printer, bitmap, whatever).
Since my company develops utilities for AutoCAD, I can say that it uses MUCH more complex mathematical routines. In general tho, it caches the geometry that is visible on the screen for quick updates. Perhaps it even has more then one cache.
Somewhere in CodeProject (I think, maybe somewhere else) someone wrote a "persistent" canvas that remembered what was drawn to it (TCL/TK has it built in). If you need, I could dig it up.


--
Joel Lucsy
GeneralRe: Preserving what is drawn to Controls Pin
Member 94235531-Aug-04 4:38
Member 94235531-Aug-04 4:38 
GeneralRe: Preserving what is drawn to Controls Pin
Joel Lucsy31-Aug-04 4:46
Joel Lucsy31-Aug-04 4:46 
GeneralRe: Preserving what is drawn to Controls Pin
Member 9423552-Sep-04 0:32
Member 9423552-Sep-04 0:32 
GeneralWhy selected items in a checkedListBox don't show in order Pin
abhishk2001@yahoo.com30-Aug-04 14:50
abhishk2001@yahoo.com30-Aug-04 14:50 
GeneralRe: Why selected items in a checkedListBox don't show in order Pin
Bill Dean30-Aug-04 16:24
Bill Dean30-Aug-04 16:24 
GeneralRe: Why selected items in a checkedListBox don't show in order Pin
S Sansanwal30-Aug-04 16:57
S Sansanwal30-Aug-04 16:57 
QuestionError: Failed to delay load library mscorlib.dll ? Pin
Cyric7430-Aug-04 14:18
Cyric7430-Aug-04 14:18 
AnswerRe: Error: Failed to delay load library mscorlib.dll ? Pin
Christian Graus30-Aug-04 15:08
protectorChristian Graus30-Aug-04 15:08 
GeneralRe: Error: Failed to delay load library mscorlib.dll ? Pin
Cyric7430-Aug-04 18:33
Cyric7430-Aug-04 18:33 
GeneralRe: Error: Failed to delay load library mscorlib.dll ? Pin
Christian Graus31-Aug-04 10:23
protectorChristian Graus31-Aug-04 10:23 
QuestionSetting the icon for a program ? Pin
Christian Graus30-Aug-04 12:02
protectorChristian Graus30-Aug-04 12:02 
AnswerRe: Setting the icon for a program ? Pin
Heath Stewart30-Aug-04 12:33
protectorHeath Stewart30-Aug-04 12:33 
GeneralRe: Setting the icon for a program ? Pin
Christian Graus30-Aug-04 12:43
protectorChristian Graus30-Aug-04 12:43 
AnswerRe: Setting the icon for a program ? Pin
Christian Graus30-Aug-04 12:41
protectorChristian Graus30-Aug-04 12:41 
GeneralRestoring a previous instance. Pin
Dionne30-Aug-04 9:40
Dionne30-Aug-04 9:40 
GeneralRe: Restoring a previous instance. Pin
Heath Stewart30-Aug-04 9:51
protectorHeath Stewart30-Aug-04 9:51 
GeneralRe: Restoring a previous instance. Pin
Dionne30-Aug-04 9:54
Dionne30-Aug-04 9:54 

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.