procedure TForm1.AntiAlias;
const
ZOOM = 16;
var
Bmp: TBitmap;
StretchMode: Integer;
begin
Bmp := TBitmap.Create;
// create a large bitmap and set coordinate extents accordingly
Bmp.SetSize(qrimage1.clientwidth * ZOOM, qrimage1.ClientHeight * ZOOM);
SetMapMode(Bmp.Canvas.Handle, MM_ISOTROPIC);
SetWindowExtEx(Bmp.Canvas.Handle, 100, 100, nil);
SetViewportExtEx(Bmp.Canvas.Handle, 100 * ZOOM, 100 * ZOOM, nil);
// without halftone we won't gain anything
SetStretchBltMode(Bmp.Canvas.Handle, HALFTONE);
// transfer what's on the list box to bitmap canvas
BitBlt(Bmp.Canvas.Handle, 0, 0, Bmp.Width, Bmp.Height,
qrimage1.Canvas.Handle, 0, 0, SRCCOPY);
Bmp.Canvas.Polygon([Point(20, 10), Point(10, 50), Point(80, 30)]);
Bmp.Canvas.Ellipse(100,100,150,150);
Bmp.Canvas.Rectangle(150,150,200,200);
// transfer bitmap contents
StretchMode := SetStretchBltMode(qrimage1.Canvas.Handle, HALFTONE);
StretchBlt(qrimage1.Canvas.Handle, 0, 0,
qrimage1.ClientWidth * ZOOM, qrimage1.ClientHeight * ZOOM,
Bmp.Canvas.Handle, 0, 0, Bmp.Width, Bmp.Height, SRCCOPY);
SetStretchBltMode(qrimage1.Canvas.Handle, StretchMode);
Bmp.Free;
end;
'델파이 > 델파이관련' 카테고리의 다른 글
델파이에서 MS Access 연결 (ADO) (0) | 2014.12.23 |
---|---|
델파이 ADO 이용하여 Excel 연결하기 (0) | 2014.10.15 |
Graphic32 Contrast, Brightness (0) | 2014.04.29 |
델파이 객체지향프로그래밍을 위한 20가지 규칙 (0) | 2012.02.27 |
델파이 Class (0) | 2012.02.27 |