|
bitmap이미지를 화면에 그리려고 하니 dc가 필요하네요..
HDC dc = ::GetWindowDC(Form_Main->Image_Picture); // TImage로 선언된 객체
여기서 dc 가 null값을 받는데.. VCL로 된 객체의 핸들을 따로 가져오는 것이 있나요?
아니면 .. 어쨌거나 TImage로 된 객체의 핸들이 있어야 진행이 될 것 같은데...
아니면 그냥 Form 전체의 Handle이 필요한 것인가요?
어떻게 해야 하는 지 ..원 ..... ?? 아시는 분 답변을 바랍니다. 꼭~~!!
if (m_JpgDec.Decoding(GetStream(), GetStreamSize())) {
HDC dc = ::GetWindowDC(Form_Main->Image_Picture); // TImage로 선언된 객체
SBMP * pBmp = m_JpgDec.GetResultBmp();
//Form_Main->Image_Picture->Picture->Bitmap->Assign(pBmp);
result = ::StretchDIBits(
dc, // device context
x, // x-coordinate of upper-left corner of dest. rect.
y, // y-coordinate of upper-left corner of dest. rect.
320, // width of destination rectangle
240, // height of destination rectangle
0, // x-coordinate of upper-left corner of source rect.
0, // y-coordinate of upper-left corner of source rect.
m_JpgDec.GetImageWidth(), // width of source rectangle
m_JpgDec.GetImageHeight(), // height of source rectangle
pBmp->bitstream, // address of bitmap bits
(BITMAPINFO *)&pBmp->header, // address of bitmap data
DIB_RGB_COLORS, // usage
SRCCOPY); // raster operation code
ReleaseDC(Form_Main->Image_Picture, dc);
}
|