Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i want to display jpeg, bmp etc. in

Status
Not open for further replies.

vkarthik

Programmer
Aug 30, 2001
126
US
i want to display jpeg, bmp etc. in my program when the user chooses that file from a file dialog box. (like a preview of what he is selecting). i use vc++ (mfc)how do i do it. do i need picture control (CStatic)? plz explain in detail.
 
Hi vkarthik

You've got two options. You can use the CStatic control (I assume this is on a dialog) and use the CStatic::SetBitmap member.

Alternatively, you can access the view or dialog's DC (device context) directly and call the CDC::BitBlt member to 'blit' a bitmap directly to the window.

Both these methods will only work with bitmaps though. For JPEGs, you'll need the conversion algorithm. Have a look at bitmap functions under CDC in the MSDN library.

Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top