C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[27612] [질문] 핸들 가져오기...
정호근 [heaven2a] 1225 읽음    2003-10-22 12:49
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);
}

+ -

관련 글 리스트
27612 [질문] 핸들 가져오기... 정호근 1225 2003/10/22
33756     Re:[질문] 핸들 가져오기... 이기주 974 2003/10/22
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.