Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: toolbar icon Pin
Heath Stewart10-May-04 6:49
protectorHeath Stewart10-May-04 6:49 
GeneralRe: toolbar icon Pin
elena1234510-May-04 10:08
elena1234510-May-04 10:08 
GeneralRe: toolbar icon Pin
Heath Stewart10-May-04 10:44
protectorHeath Stewart10-May-04 10:44 
GeneralDatabase Wrapper Pin
JohnMess10-May-04 5:25
sussJohnMess10-May-04 5:25 
GeneralRe: Database Wrapper Pin
Heath Stewart10-May-04 5:40
protectorHeath Stewart10-May-04 5:40 
GeneralRe: Database Wrapper Pin
johnmess10-May-04 6:31
sussjohnmess10-May-04 6:31 
QuestionImage retrieval from ImageList is slow? Pin
Judah Gabriel Himango10-May-04 4:39
sponsorJudah Gabriel Himango10-May-04 4:39 
AnswerRe: Image retrieval from ImageList is slow? Pin
Heath Stewart10-May-04 4:47
protectorHeath Stewart10-May-04 4:47 
If you're intersted in the internal workings of classes, use the IL disassembler (ildasm.exe) that ships with the .NET Framework SDK or use a decent decompiler if you don't know IL like .NET Reflector[^].

The ImageList class uses the Image list common control, so it encapsulates said control by sending Windows messages (using the macros, actually), which requires marshaling to/from unmanaged code.

A faster way, however, is to use ImageList.Draw. This uses the HDC of the Graphics for your painting operation - as well as the other parameters - to have the image list common control draw the image directly to the on- or off-screen bitmap (depending on whether or not you're using double-buffering), or to the Image you're trying to draw (obviously not the case here). This will definitely be faster than your first method and would provide the robustness you may be looking for (like if the images in the list change often and you just want to always draw the first one, or some other index), as opposed to coming up with some caching schema and implementing it using your latter approach.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Image retrieval from ImageList is slow? Pin
Judah Gabriel Himango10-May-04 4:53
sponsorJudah Gabriel Himango10-May-04 4:53 
GeneralRe: Image retrieval from ImageList is slow? Pin
Judah Gabriel Himango10-May-04 6:19
sponsorJudah Gabriel Himango10-May-04 6:19 
GeneralRe: Image retrieval from ImageList is slow? Pin
leppie10-May-04 11:55
leppie10-May-04 11:55 
Generaljumping from one form to another Pin
michael.wikstrom10-May-04 3:29
michael.wikstrom10-May-04 3:29 
GeneralRe: jumping from one form to another Pin
Heath Stewart10-May-04 3:35
protectorHeath Stewart10-May-04 3:35 
GeneralSending binary data with webservices Pin
Edgar R. C.10-May-04 3:01
Edgar R. C.10-May-04 3:01 
GeneralRe: Sending binary data with webservices Pin
Heath Stewart10-May-04 3:09
protectorHeath Stewart10-May-04 3:09 
GeneralRe: Sending binary data with webservices Pin
Edgar R. C.10-May-04 3:57
Edgar R. C.10-May-04 3:57 
GeneralRe: Sending binary data with webservices Pin
Heath Stewart10-May-04 4:30
protectorHeath Stewart10-May-04 4:30 
GeneralRe: Sending binary data with webservices Pin
Edgar R. C.11-May-04 9:27
Edgar R. C.11-May-04 9:27 
GeneralRe: Sending binary data with webservices Pin
Heath Stewart10-May-04 4:39
protectorHeath Stewart10-May-04 4:39 
QuestionINT Declarations? Pin
Anonymous10-May-04 2:41
Anonymous10-May-04 2:41 
AnswerRe: INT Declarations? Pin
Heath Stewart10-May-04 2:55
protectorHeath Stewart10-May-04 2:55 
GeneralC# Builder Pin
sreejith ss nair10-May-04 1:01
sreejith ss nair10-May-04 1:01 
GeneralRe: C# Builder Pin
Heath Stewart10-May-04 2:36
protectorHeath Stewart10-May-04 2:36 
QuestionHow to compare the file? Pin
m7779-May-04 22:37
m7779-May-04 22:37 
AnswerRe: How to compare the file? Pin
Heath Stewart10-May-04 2:52
protectorHeath Stewart10-May-04 2:52 

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.