How to display a JPG file using BitBlt?
-
Hi again, I need to display a JPG file from a location - ex. c:\img.jpg using BitBlt but i don't know how to implement. This will be under OnDraw() or OnPaint() function. I read that this will use CDC but i don't know how to relate. If you knew of a thread please inform me. Hope you can help me. Thanks.
-
Hi again, I need to display a JPG file from a location - ex. c:\img.jpg using BitBlt but i don't know how to implement. This will be under OnDraw() or OnPaint() function. I read that this will use CDC but i don't know how to relate. If you knew of a thread please inform me. Hope you can help me. Thanks.
Example:
void CMyWnd::OnPaint()
{
CPaintDC dc(this); // device context for paintingCImage JPEGImage;
JPEGImage.Load(_T("c:\\img.jpg"));
JPEGImage.BitBlt(dc, 0, 0, SRCCOPY);
}Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hi again, I need to display a JPG file from a location - ex. c:\img.jpg using BitBlt but i don't know how to implement. This will be under OnDraw() or OnPaint() function. I read that this will use CDC but i don't know how to relate. If you knew of a thread please inform me. Hope you can help me. Thanks.
-
Example:
void CMyWnd::OnPaint()
{
CPaintDC dc(this); // device context for paintingCImage JPEGImage;
JPEGImage.Load(_T("c:\\img.jpg"));
JPEGImage.BitBlt(dc, 0, 0, SRCCOPY);
}Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Is JPEGImage a derived class? To create? or already exist.
-
Is JPEGImage a derived class? To create? or already exist.
TooShy2Talk wrote:
Is JPEGImage a derived class?
No just a quickly chosen variable name. The class is CImage... I forgot:
#include <atlimage.h> // CImage class
If you're using VC 6, upgrade! then I'll show a sample the long way. The CImage class makes it easy :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: