Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to display an image located at my local drive(D:\\..).

Please provide me with the code.I am using visual studio 2005(win 32 console application).


Thanks,
Posted

If you have DxSDK installed on your system. there is a sample application for the same. check that out.
 
Share this answer
 
Comments
aksiit001 22-Mar-12 8:33am    
Can you please share the link?
You can get directX Sdkhere[^]

But use directx to display image only if you have to use directX. I would rather use GDI if my requirement is to display image.
 
Share this answer
 
Comments
aksiit001 22-Mar-12 8:42am    
thanks for the reply,but i am trying to display the image through gdi.please see the code below,but it is throwing exception.please help me out-

Image image(_T("D:\\Images\\1.jpg"),false);
Graphics *m_graphics;
m_graphics->DrawImage(&image, 60, 10);




HICON hIcon = LoadIcon(NULL, IDI_APPLICATION);
Bitmap bitmap(hIcon);
m_graphics->DrawImage(&bitmap, 10, 10);
thanks for the reply,but i am trying to display the image through gdi.please see the code below,but it is throwing exception.please help me out-

Image image(_T("D:\\Images\\1.jpg"),false);
Graphics *m_graphics;
m_graphics->DrawImage(&image, 60, 10);




HICON hIcon = LoadIcon(NULL, IDI_APPLICATION);
Bitmap bitmap(hIcon);
m_graphics->DrawImage(&bitmap, 10, 10)
;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900