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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.