|
|
Comments and Discussions
|
|
 |

|
I'm sorry to tell you that you maybe upload wrong program, or the wrong picture to the src
|
|
|
|

|
fatal error RC1015: cannot open include file 'res\ListImage.rc2'
please help.
Email:wsmcnu@gmail.com
|
|
|
|

|
If you load enough quantities pictures in this application. you will find it does work at all. In my test, the limitation is 4973 (720 * 480 pixel) images.
After that I nvestigated in this code and found solution eventually.
Code snapshot
in ListImageCtrl.cpp
at line
95 //Adding Bitmap to the Imagelist
96 CBitmap* pImage = NULL;
97 pImage = new CBitmap();
98 pImage.Attach(bitm);
99 int imgP=m_imageList.Add(pImage,RGB(0,0,0));
100 //Link to the added listview item
101 InsertItem(m_TotCount,nFileText,imgP);
add code below
pImage.Detach();
DeleteObject( bitm );
delete pImage;
|
|
|
|

|
Horrible and beginner code.
The right method is to use COM (Thumbnail interfaces), which is what Explorer uses.
|
|
|
|

|
so please tell us the right way. thank u!
|
|
|
|

|
Any body know how to do this.
Please help
~Regards
|
|
|
|

|
It is useful to me,Thank you very much!
|
|
|
|

|
Images are streched in ListCtrl, to fix it we have to calculate Ratio before calling CopyImage (and pass correct Ratio-parameter to it).
OleLoadPicturePath allow to load not only JPG files, but BMP (bitmap), WMF (metafile), ICO (icon) and GIF format.
c++ developer. Kiev, Ukraine
|
|
|
|
|

|
New programmer, I followed by still got errors: Can some one send me
compiled code.
Thanks,
\vc\ListImage\listImageCtrl.cpp(90) : error C2065: 'DoEvents' : undeclared identifier
D:\vc\ListImage\listImageCtrl.cpp(105) : error C2065: 'ConvertDoubleToString' : undeclared identifier
D:\vc\ListImage\listImageCtrl.cpp(121) : error C2065: 'LoadPicture' : undeclared identifier
D:\vc\ListImage\listImageCtrl.cpp(121) : error C2440: 'initializing' : cannot convert from 'int' to 'struct HBITMAP__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
D:\vc\ListImage\listImageCtrl.cpp(127) : error C2065: 'm_imageList' : undeclared identifier
D:\vc\ListImage\listImageCtrl.cpp(127) : error C2228: left of '.Add' must have class/struct/union type
|
|
|
|

|
Ths is a very good and usegul article. Thank you.
I have a question:
To draw the selected image you download the image from its file again:
Image img( A2W(strPath) );
...........................
Is it possible to retrieve the image from the CListCtrl, like
CListCtrl m_listCtrl;
LVITEM lwi;
................// prepare lwi
m_listCtrl.GetItem(&lvi);
CImageList* pImageList = m_listCtrl.GetImageList();
IMAGEINFO ii;
....................// prepare ii
pImageList->GetImageInfo(lvi.iImage, &ii);
CImage image;
image.Attach(ii.hbmpImage);
...................// Draw it
I tried it, but it failed: on bitmap 20x20 entered in CImage list it retrieved the empty bitmap 20x280.
Maybe you know what is wrong?
geoyar
|
|
|
|

|
I would strongly suggest that you modify this to use CXImage for decoding/drawing.It is a lot more esier to use and can open a lot of formats.CxImage is a project here, on CodeProject.
|
|
|
|

|
i want to add a checkbox into each thumbnail. how can i do that? thanks
neverchange
|
|
|
|

|
Hi,
I would like to know is it possible to remove the file name of the thumbnail image, from the list control. If so, please explaine?
Thnaks and regards
Alvin
This is alwittta
|
|
|
|

|
Hi,
In the List Control you cannot add thumbnail without text (filename). What you can do is you can add blank space ("") in "SetItemText()" function instead of displaying filename. But when you select the thumbnail in the run mode, a blank selection will be appeared in the bottom of the thumbnail.
..............
thank
Karpaga Raj
|
|
|
|

|
Hi,
I have downloaded the file that you put the link for at the top. But after compiling it first thing is RES folder is missing. And another thing is, it does not give the same output as you shown in the snap in your article.. it shows me report style view of list control. How can I get exactly same kind of output ? And is it possible to change the resolution of preview on the fly ?
Regards,
Jigar Mehta
|
|
|
|

|
Hi,
I want to change the image thumbnail preview size on the runtime. So, does this class support that ?
Regards,
Jigar mehta
|
|
|
|

|
i ran the program at first, it worked very well. i sould see the thumbnails as said.
when a copies the function LoadPicture to myProgram.cpp i got the following error on compilation.
error C2664: 'MultiByteToWideChar' : cannot convert parameter 3 from 'class CString' to 'const char *'
after many attempts i am unable to find a way to give proper path of the file or make conversion from CString to char* work.
please help.
thnx in adv.
|
|
|
|

|
You can use: char *str; str = new char[100]; if(!str) exit(1); strcpy(str, TheCStringVariable); /*convert CString to char **/ You can e-mail me: MicroDeniz@Gmail.com You will make me happy
|
|
|
|

|
You can use: CString b = "Hello!"; char *a; a = new char[100]; ASSERT(a); strcpy(a, b); //another way: wsprintf(a, "%s", b); MessageBox(a); Good bye Email me;)
|
|
|
|
|

|
Any idea, how can I ROTATE 90, 180 etc using an IPicture object, once it is loaded and showing on screen...
Thanks
Alex
|
|
|
|

|
Hi,
I am trying to have two sets of list displaying pictures from different folders, any help about this? Will be much appreciated!
Thank you!
Joshua
|
|
|
|

|
hi,
If you want to display the folders images in listview,
first get the file in that folder by FindFileFirst() functions and you can pass the filename in the image load function(which will load the thumb images to the listview).
If you need any coding assistance...you can mail me.(talk2karpagarajan@hotmail.com)
bye
Rajan
|
|
|
|

|
One of the things that people look for a CodeProject is quality source code.
Your program was obviously the result of much research. You fiddled the code till it worked; and it's not clear to you why. You've got a blend of SDK and MFC code that is inconsistent and hard to follow.
Why are you copying the bitmap you loaded? What's wrong with the HBITMAP returned from IPicturc::get_Handle()?
It would be nice if all that work with aspect ratios actually resulted in a thumbnail with the aspect ratio was preserved.
Why are CreateCompatibleBitmap and CreateCompatibleDC called so many times? You only need two DC objects and two bitmap objects.
You also only need three SelectObject calls, not five.
|
|
|
|

|
Easy to criticize isn't it. If you know so much why don't you fix it. Either put up or shut up
|
|
|
|

|
I saw that the sample code if thumb view always use LVS_ICON style, and get the problem when image focused, it's blue masked and not easy to see the image.
I also checked that MS file manager's view-> thumbview just display a blue frame which will not affect original image. do u know how to do that?
Best Regards,
KW
|
|
|
|

|
Could you tell the way to implement drag and drop image item in thumbnailview in CListCtrl? It likes thumbnail view in explorer!
Thank you!
|
|
|
|

|
Hi,
If you want to enable the drag and drop in a CListCtrl, first enable the "Accept File" Property of your control(List view). And enable the WM_DROPFILES message mapping. In that function insert the coding which i have given in this article.
Go through the source code. You can find the OnDropFiles event.
If you need the full source code, click on the below link
Click my link - www.buddiesinfotech.com/ListImage.zip
bye thanks
Rajan
|
|
|
|
|

|
Hi PhucFBK
Yeah...thats ok.
To drag and drop within the CListCtrl,
You have to Add the MESSAGE HANDLER "LVN_BEGINDRAG" for the CListCtrl. And add the Windows messaging function called ON_WM_QUERYDRAGICON(WM_QUERYDRAGICON),WM_LBUTTONUP.
In that you have to do the coding for drag and drop within that control. If you need any source code for that please contact to my email id talk2karpagarajan@yahoo.com
bye
thanks
Rajan
|
|
|
|

|
Hi Rajan,
You are very kind!
I am happy to see your code about the problem, I will get alot of things in it!
If possible, pls send to me: phucfbk@yahoo.com, or phucfbk@gmail.com
Thanks you!
|
|
|
|

|
I have a file with ".jpg" pictures, how do I get that to become, "res\ListImage.rc2" which is where the compile is failing because it cannot open, "res\ListImage.rc2"?
Thanks!
William
Fortes in fide et opere!
|
|
|
|

|
Hi...
Its my sample one.
You can do your own code using my article.
If you want the full source code,get it from the following link
www.discussweb.com
in that goto
"Discussweb Web Design Forum > Application Programming > Visual C++ and C Style languages" topic "Showing the Image file thumbnail view in ListView control using VC++ 6.0"
Or
Click my link - www.buddiesinfotech.com/ListImage.zip
bye thanks
Rajan
|
|
|
|

|
Very useful and informative post... thnks Karpagaraj..
KlassiCs
http://www.discussweb.com
|
|
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This sample program shows how to create a thumbnail view in ListView control.
| Type | Article |
| Licence | CPOL |
| First Posted | 1 Oct 2004 |
| Views | 150,700 |
| Downloads | 1,670 |
| Bookmarked | 70 times |
|
|