Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralRe: uk dates Pin
robmays20-Apr-04 2:53
robmays20-Apr-04 2:53 
GeneralRe: uk dates Pin
Heath Stewart20-Apr-04 4:10
protectorHeath Stewart20-Apr-04 4:10 
GeneralRe: uk dates Pin
robmays20-Apr-04 4:21
robmays20-Apr-04 4:21 
GeneralRe: uk dates Pin
Heath Stewart20-Apr-04 4:15
protectorHeath Stewart20-Apr-04 4:15 
QuestionGetScrollInfo in TreeView? Pin
Anthony_Yio19-Apr-04 22:56
Anthony_Yio19-Apr-04 22:56 
AnswerRe: GetScrollInfo in TreeView? Pin
Heath Stewart20-Apr-04 4:07
protectorHeath Stewart20-Apr-04 4:07 
GeneralRe: GetScrollInfo in TreeView? Pin
Anthony_Yio20-Apr-04 15:27
Anthony_Yio20-Apr-04 15:27 
Questionhow do I make a thumbnail screenshot of a webpage programatically? Pin
Nathan Ridley19-Apr-04 22:55
Nathan Ridley19-Apr-04 22:55 
AnswerRe: how do I make a thumbnail screenshot of a webpage programatically? Pin
Mike Ellison20-Apr-04 3:36
Mike Ellison20-Apr-04 3:36 
GeneralRe: how do I make a thumbnail screenshot of a webpage programatically? Pin
Nathan Ridley20-Apr-04 11:19
Nathan Ridley20-Apr-04 11:19 
GeneralSet a node in a Treeview to bold Pin
Gian19-Apr-04 22:41
Gian19-Apr-04 22:41 
GeneralRe: Set a node in a Treeview to bold Pin
Baris Kurtlutepe20-Apr-04 3:07
Baris Kurtlutepe20-Apr-04 3:07 
GeneralRe: Set a node in a Treeview to bold Pin
Heath Stewart20-Apr-04 4:21
protectorHeath Stewart20-Apr-04 4:21 
GeneralRe: Set a node in a Treeview to bold Pin
Gian20-Apr-04 5:40
Gian20-Apr-04 5:40 
Generalerror with tab page Pin
robmays19-Apr-04 22:14
robmays19-Apr-04 22:14 
GeneralRe: error with tab page(Heath) Pin
robmays19-Apr-04 22:31
robmays19-Apr-04 22:31 
GeneralRe: error with tab page Pin
Heath Stewart20-Apr-04 4:34
protectorHeath Stewart20-Apr-04 4:34 
GeneralA managed DirectDraw / DirectX question Pin
yoaz19-Apr-04 21:32
yoaz19-Apr-04 21:32 
GeneralRe: A managed DirectDraw / DirectX question Pin
Jeremy Kimball20-Apr-04 6:42
Jeremy Kimball20-Apr-04 6:42 
GeneralRe: A managed DirectDraw / DirectX question Pin
yoaz20-Apr-04 8:15
yoaz20-Apr-04 8:15 
Questioncan i get a 256 colors bitmap from DC directly ? Pin
fu019-Apr-04 21:04
fu019-Apr-04 21:04 
AnswerRe: can i get a 256 colors bitmap from DC directly ? Pin
Heath Stewart20-Apr-04 4:47
protectorHeath Stewart20-Apr-04 4:47 
First, don't assume the desktop is 800x600. Use either SystemInformation.VirtualScreen or Screen.WorkingArea to get the Rectangle to use to size the Bitmap.

Second, you can create a 256-color bitmap by using the Bitmap.Bitmap(int, int, PixelFormat) constructor. Then create a new Graphics object for that bitmap and use GetHdc to get the DC which you could paint into. Make sure you call ReleaseHdc and then dispose your Graphics object, but do not call GC.Collect - just call Graphics.Dispose on anything you create. Calling GC.Collect can be very expensive and - if you dispose things correctly (in order to free native resources, which GC.Collect won't do) - is unnecessary.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
yoaz20-Apr-04 21:24
yoaz20-Apr-04 21:24 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
Heath Stewart21-Apr-04 3:09
protectorHeath Stewart21-Apr-04 3:09 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
yoaz21-Apr-04 5:26
yoaz21-Apr-04 5:26 

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.