그렇게 이 기능이 필요한 거 같지는 않은데... 있으면 그런대로 유용한 거는 같다...
procedure TGEMAINF.mnuPrintClick(Sender: TObject);var DeskTopDC: HDc; DeskTopCanvas: TCanvas; BitmapRect: TRect; Bitmap: TBitmap;begin If MDIChildCount = 0 Then Exit;
Try Bitmap := TBitmap.Create; {BMP를 저장할 bitmap 생성}
BitMap.Width := ActiveMDIChild.Width; BitMap.Height := ActiveMDIChild.Height; BitmapRect := Rect(0, 0, ActiveMDIChild.Width, ActiveMDIChild.Height);
DeskTopDC := GetWindowDC(ActiveMDIChild.Handle); DeskTopCanvas := TCanvas.Create; DeskTopCanvas.Handle := DeskTopDC;
Bitmap.Canvas.CopyRect(BitmapRect, DeskTopCanvas, BitmapRect);
Bitmap.SaveToFile('C:\Dev\EXE\images\IMSI.BMP');
ShellExecute(handle, 'open', 'C:\Dev\EXE\images\IMSI.BMP', nil, nil, SW_MAXIMIZE);
Finally ReleaseDC(GetDeskTopWindow, DeskTopDC); DeskTopCanvas.Free; Bitmap.Free; end;end;
댓글 없음:
댓글 쓰기