Board index » delphi » Fit an bitmap onto Image.Canvas.Polygon()

Fit an bitmap onto Image.Canvas.Polygon()

How can I put an bitmap picture onto a "Image.Canvas.Polygon()" flat,
without overwritting the rest of the image.It doesn't work with
Image.canvas.brush.bitmap, becouse it will take only a small part of the
bitmap and fit this part many times onto my polygon.
Thanks for your help      Thom
 

Re:Fit an bitmap onto Image.Canvas.Polygon()


You could use a polygon based Clipping region.

It might look something like this:

var
    hr : HRGN;
    pts : array [0..3] of TPoint;
begin
   pts[0] := Point(50,0);
   pts[1] := Point(0,50);
   pts[2] := Point(50,300);
   pts[3] := Point(100,50);

   hr := CreatePolygonRgn(pts,4,ALTERNATE);
   SelectClipRgn(Canvas.Handle,hr);
   Canvas.Draw(0,0,Image1.Picture.Bitmap);
   SelectClipRgn(Canvas.Handle,0);
   DeleteObject(hr);
end;

Quote
On Mon, 08 Feb 1999 17:27:05 +0100, Carmelia_Da...@hotmail.com wrote:
>How can I put an bitmap picture onto a "Image.Canvas.Polygon()" flat,
>without overwritting the rest of the image.It doesn't work with
>Image.canvas.brush.bitmap, becouse it will take only a small part of the
>bitmap and fit this part many times onto my polygon.
>Thanks for your help      Thom

Chris Hill
Chris...@aol.com

Other Threads