This will paint directly to the screen just as example of not having to use a TImage. You'll have to modify for your needs...
procedure TForm1.Button2Click(Sender: TObject); var jpg: TJPegImage; bmpInfo: TBitmapInfo; bits: Pointer; bmp: TBitmap; imgHeaderSize, ImgSize: Cardinal; ScreenDC: HDC; begin jpg:= TJpegImage.Create; bmp:= TBitmap.Create; ScreenDC:= getdc(0); try jpg.LoadFromFile('c:\temp\handshak.jpg'); bmp.Assign(jpg); GetDIBSizes(bmp.Handle, imgHeaderSize, ImgSize); GetDIBSizes(jpg.Handle, imgHeaderSize, ImgSize); GetMem(bits, ImgSize); try GetDIB(bmp.Handle, bmp.Palette, bmpInfo, bits^); StretchDIBits(ScreenDC, //Image1.Canvas.Handle, 0, 0, Image1.Width, Image1.Height, 0, 0, jpg.Width, jpg.Height, bits, bmpInfo, DIB_RGB_COLORS, SRCCOPY); finally FreeMem(bits); end; finally jpg.Free; bmp.Free; ReleaseDC(0, ScreenDC); end; end;
'프로그래밍 > Delphi' 카테고리의 다른 글
xnView:GFL_SDK Bitmap을 Gfl_Bitmap으로 변환(메모리 방식) (0) | 2009.12.04 |
---|---|
xnView-GFL_SDK : 메모리를 이용한 데이터 복사(gflSaveBitmapIntoMemory) 참고자료 (0) | 2009.12.04 |
URLEncoding 함수 사용하기 (1) | 2009.11.04 |
TIdHTTP.Post로 질의 및 결과 받기 (0) | 2009.11.04 |
"coreide70.bpl" Access violation 오류 대처법 - 통합IDE 환경에서 디버깅 오류 (2) | 2009.10.06 |