Click here to Skip to main content
16,006,065 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: Shading Pin
Tim Craig6-Apr-08 16:05
Tim Craig6-Apr-08 16:05 
GeneralRe: Shading Pin
El Corazon8-Apr-08 7:20
El Corazon8-Apr-08 7:20 
QuestionPartially redraw Image Pin
invader824-Apr-08 3:31
invader824-Apr-08 3:31 
GeneralRe: Partially redraw Image Pin
Luc Pattyn4-Apr-08 3:41
sitebuilderLuc Pattyn4-Apr-08 3:41 
GeneralRe: Partially redraw Image Pin
invader824-Apr-08 3:50
invader824-Apr-08 3:50 
GeneralGDI+ - Disposing Pin
molcaobarman30-Mar-08 7:14
molcaobarman30-Mar-08 7:14 
GeneralRe: GDI+ - Disposing Pin
Mark Salsbery30-Mar-08 9:40
Mark Salsbery30-Mar-08 9:40 
GeneralRe: GDI+ - Disposing Pin
Luc Pattyn30-Mar-08 10:24
sitebuilderLuc Pattyn30-Mar-08 10:24 
Hi,

you should call Dispose on those objects that offer it, as soon as you don't need them
anymore. Creating and disposing GDI objects may be expensive, so it is indeed wise
to avoid these operations in every OnPaint(). So you create them once "globally",
and keep them alive as long as the app lives; that is perfect. On exit, the system
will take care of them (as it always did with resources, even long before .NET came
into this world).

BTW: you don't have the right to dispose of stuff you did not create or ordered created;
this applies to the Pens class, the Brushes class, etc.
So you can replace myPen = new Pen(Color.Blue); by myPen=Pens.Blue;
and not worry about disposing of it at all.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: GDI+ - Disposing Pin
molcaobarman1-Apr-08 21:23
molcaobarman1-Apr-08 21:23 
GeneralRe: GDI+ - Disposing Pin
Luc Pattyn1-Apr-08 23:38
sitebuilderLuc Pattyn1-Apr-08 23:38 
GeneralRe: GDI+ - Disposing Pin
molcaobarman2-Apr-08 0:16
molcaobarman2-Apr-08 0:16 
QuestionSemi Transparent UserControl Pin
maxatlis30-Mar-08 0:04
maxatlis30-Mar-08 0:04 
GeneralRe: Semi Transparent UserControl [modified] Pin
Rob Smiley18-Apr-08 9:48
Rob Smiley18-Apr-08 9:48 
GeneralFlashy GDI+ Pin
Reelix28-Mar-08 0:58
Reelix28-Mar-08 0:58 
GeneralRe: Flashy GDI+ Pin
Christian Graus6-Apr-08 16:30
protectorChristian Graus6-Apr-08 16:30 
QuestionTemplate Matching? Pin
jamilkhan00727-Mar-08 21:45
jamilkhan00727-Mar-08 21:45 
QuestionHighest quality text using TextRender Pin
danreber18-Mar-08 6:16
danreber18-Mar-08 6:16 
GeneralRe: Highest quality text using TextRender Pin
Rob Smiley18-Apr-08 11:43
Rob Smiley18-Apr-08 11:43 
QuestionErasing a line C# Pin
Denver Thomas17-Mar-08 20:32
Denver Thomas17-Mar-08 20:32 
GeneralRe: Erasing a line C# Pin
Pete O'Hanlon18-Mar-08 11:33
mvePete O'Hanlon18-Mar-08 11:33 
QuestionWhat thing is done from IStream::Read to IWMReaderCallbackAdvanced::OnStreamSample? Pin
markliu-codeproject16-Mar-08 22:14
markliu-codeproject16-Mar-08 22:14 
GeneralCreateDIBitmap with 32bits RGBA data Pin
Vlasta_12-Mar-08 23:02
Vlasta_12-Mar-08 23:02 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 7:32
Mark Salsbery13-Mar-08 7:32 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Vlasta_13-Mar-08 8:24
Vlasta_13-Mar-08 8:24 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 8:28
Mark Salsbery13-Mar-08 8:28 

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.