showing the preview of an image
-
in windows explorer, when we click on the icon of an image, we get to see the preview of that image. i want to do the same in my application, but have no idea of how to do it. can anyone please give me any advice on this??? thanks in advance...
vijay.
-
in windows explorer, when we click on the icon of an image, we get to see the preview of that image. i want to do the same in my application, but have no idea of how to do it. can anyone please give me any advice on this??? thanks in advance...
vijay.
Where you want to show this preview on the main dialog or other dialog
WhiteSky
-
Where you want to show this preview on the main dialog or other dialog
WhiteSky
WhiteSky wrote:
Where you want to show this preview on the main dialog or other dialog
on the same dialog.
vijay.
-
WhiteSky wrote:
Where you want to show this preview on the main dialog or other dialog
on the same dialog.
vijay.
So just add a static control, with the
SS_BITMAP
style, to your dialog's template.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
WhiteSky wrote:
Where you want to show this preview on the main dialog or other dialog
on the same dialog.
vijay.
vijay7173 wrote:
same dialog
But I suggest use of foreign dialog instead same dialog you insert a CDialog to your project and show preview on that dialog if you use of this way you have more control for example you can move this window without any work or change size of show image on the dialog or insert controls to this dialog for control picture,anyway if you want to use this way on the codeproject is more articles for example search for 3dmax,you can find an article in this article you can see behavior like 3dmax window);)
WhiteSky
-
vijay7173 wrote:
same dialog
But I suggest use of foreign dialog instead same dialog you insert a CDialog to your project and show preview on that dialog if you use of this way you have more control for example you can move this window without any work or change size of show image on the dialog or insert controls to this dialog for control picture,anyway if you want to use this way on the codeproject is more articles for example search for 3dmax,you can find an article in this article you can see behavior like 3dmax window);)
WhiteSky
no, i dont want to have much features for the preview. i just need to show a thumbnail preview of the image icon selected. i dont want to provide the scaling options either. how can i do it???
vijay.
-
So just add a static control, with the
SS_BITMAP
style, to your dialog's template.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
DavidCrow wrote:
So just add a static control, with the SS_BITMAP style, to your dialog's template.
well sir, i did the same. but the static control does not display the bitmap image that i specify. However, is able to display the system icons (like Question mark Icon, or an Information Icon):confused:. i really dont know what mistake i am doing. :doh:
vijay.
-
DavidCrow wrote:
So just add a static control, with the SS_BITMAP style, to your dialog's template.
well sir, i did the same. but the static control does not display the bitmap image that i specify. However, is able to display the system icons (like Question mark Icon, or an Information Icon):confused:. i really dont know what mistake i am doing. :doh:
vijay.
CStatic has a function
SetBitmap(that needs to hbitmap)
but before it set Type of preperty window to Bitmap
WhiteSky
-
no, i dont want to have much features for the preview. i just need to show a thumbnail preview of the image icon selected. i dont want to provide the scaling options either. how can i do it???
vijay.
One good way is David Crow answer other way is use of
WM_ERASEBKGND
for show preview of image
WhiteSky
-
DavidCrow wrote:
So just add a static control, with the SS_BITMAP style, to your dialog's template.
well sir, i did the same. but the static control does not display the bitmap image that i specify. However, is able to display the system icons (like Question mark Icon, or an Information Icon):confused:. i really dont know what mistake i am doing. :doh:
vijay.
vijay7173 wrote:
i really dont know what mistake i am doing.
And without seeing a relevant code snippet, neither do we.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
no, i dont want to have much features for the preview. i just need to show a thumbnail preview of the image icon selected. i dont want to provide the scaling options either. how can i do it???
vijay.
Not problem I think its easy for you but if you have problem and I can help you you can ask;)
WhiteSky
-
Not problem I think its easy for you but if you have problem and I can help you you can ask;)
WhiteSky
still cant get it work. :( below is the sample code snippet that isnt working for me.
CStatic m_ImagstBox[5]; m_ImagstBox[i].Create(_T("BMP"),WS_CHILD|WS_VISIBLE|SS_ICON|SS_CENTERIMAGE|SS_SUNKEN,CRect(l,50,r,100), this,1001+i); m_ImagstBox[i].SetIcon(::LoadIcon(NULL,MAKEINTRESOURCE(IDI_BMP)));
in the above code,IDI_BMP
is the id of the icon that i want to display. but i dont know why it is not working. if i specify something likeIDI_INFORMATION
, then it displays the information icon in the static control. i even tried theSetBitnap
function, to display a bitmap instead of an icon. but could not get it work. below is the sample code that i had written.m_st[i].SetBitmap(::LoadBitmap(NULL,MAKEINTRESOURCE(IDB_BITMAP_HOME)));
i am new to MFC and i am sure that i am doing a mistake some where in the code. can u please point out where i am doing the mistake?vijay.
-
still cant get it work. :( below is the sample code snippet that isnt working for me.
CStatic m_ImagstBox[5]; m_ImagstBox[i].Create(_T("BMP"),WS_CHILD|WS_VISIBLE|SS_ICON|SS_CENTERIMAGE|SS_SUNKEN,CRect(l,50,r,100), this,1001+i); m_ImagstBox[i].SetIcon(::LoadIcon(NULL,MAKEINTRESOURCE(IDI_BMP)));
in the above code,IDI_BMP
is the id of the icon that i want to display. but i dont know why it is not working. if i specify something likeIDI_INFORMATION
, then it displays the information icon in the static control. i even tried theSetBitnap
function, to display a bitmap instead of an icon. but could not get it work. below is the sample code that i had written.m_st[i].SetBitmap(::LoadBitmap(NULL,MAKEINTRESOURCE(IDB_BITMAP_HOME)));
i am new to MFC and i am sure that i am doing a mistake some where in the code. can u please point out where i am doing the mistake?vijay.
You have two ways create CStatic on your code or insert Static control of ToolBox;). But your problem check this code
m_ImagstBox[0].SetIcon(::LoadIcon**(AfxGetApp()->m_hInstance**,MAKEINTRESOURCE(IDI_BMP)));
And same For
SetBitmap
WhiteSky
-
You have two ways create CStatic on your code or insert Static control of ToolBox;). But your problem check this code
m_ImagstBox[0].SetIcon(::LoadIcon**(AfxGetApp()->m_hInstance**,MAKEINTRESOURCE(IDI_BMP)));
And same For
SetBitmap
WhiteSky
oh yes, now its working. I have now learnt something from that. thank u. :)
vijay.
-
oh yes, now its working. I have now learnt something from that. thank u. :)
vijay.
You're welcome;)
WhiteSky