The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Grincheux on November 23, 2006, 12:47:43 PM

Title: Images in Listview
Post by: Grincheux on November 23, 2006, 12:47:43 PM
I am trying to write a small ACDSee software and meet some problems with image into a listview.

When Windows sends LVN_GETDISPINFO I load the picture and draw it into an imagelist.

On the screen I temporarily see the image and it is replaced by a white image !

I don't understand. And MSDN does not say anything very interesting on using images into listview.

I join my project expecting some help :dance:.

Thanks



[attachment deleted by admin]
Title: Re: Images in Listview
Post by: PBrennick on November 23, 2006, 07:56:29 PM
I could not build the project to test your problem because you did not include the res folder in your zip.

Paul
Title: Re: Images in Listview
Post by: six_L on November 27, 2006, 01:14:35 PM
Hey,PBrennick
maybe we don't need res file. here is a exe that i made with his source code.

more German words, read difficult.
Title: Re: Images in Listview
Post by: six_L on November 30, 2006, 05:53:07 PM
Hey,Grincheux
.DATA?
Pointers    dd OBJECTS_COUNT dup(?)
.CODE
;-------- VirtualAlloc --------
mov     esi, OBJECTS_COUNT
@@:
invoke  VirtualAlloc, 0, OBJECT_SIZE, MEM_COMMIT, PAGE_READWRITE
dec     esi
mov     [Pointers + esi*4], eax
jnz     @B
@@:
mov     eax, [Pointers + esi*4]
invoke  VirtualFree, eax, 0, MEM_RELEASE
inc     esi
cmp     esi, OBJECTS_COUNT
jne     @B
;==============================================================================

Quotecausation:
1. made the windows msg to be mess
2. the memorys allocating have some problems. one JPG file should be a piece of memory
;==============================================================================
maybe the code works ok while a directory has one JPG file.

[attachment deleted by admin]
Title: Re: Images in Listview
Post by: PBrennick on November 30, 2006, 06:10:35 PM
Is that a fact?

Then how do you explain this and the errors it creates when the bitmaps do not exist? I prefer to use the toolbar.


IDB_BARREOUTILS         BITMAP                  "Res\\ToolBar.bmp"
IDB_BO16_01             BITMAP                  "Res\\BO1616_01.bmp"


Paul
Title: Re: Images in Listview
Post by: six_L on December 01, 2006, 02:09:11 AM
there are the "Res\\ToolBar.bmp","Res\\BO1616_01.bmp" in his original zip file.
Title: Re: Images in Listview
Post by: PBrennick on December 01, 2006, 02:50:34 AM
Grincheux,
Quote
I join my project expecting some help
This sounds a bit presumptous to me, but I just love your user name.  :U

six_L,
Thanks,
So you are using them. You are confusing me.  :dazzled:

Anyway, I guess my first download failed as it did not have that folder. The one I just got has it.

I'm outta, here, stay cool  :8)

Paul
Title: Re: Images in Listview
Post by: xandaz on August 20, 2010, 05:49:05 PM
   Hey. Any ideas on how to add images of different sizes either to an imagelist and a listview control? should i use ownerdraw? i'm making a resource viewer and i'm currently using shell32 and explorer.exe except some bitmaps are different in size from the others. i'd like to know what to do about this . If someone has answers feel free to reply.
   Ty and bye.
   best regards  :U