Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Polygone auf Graphics32 Layer (https://www.delphipraxis.net/158449-polygone-auf-graphics32-layer.html)

Lenny 18. Feb 2011 02:17

Polygone auf Graphics32 Layer
 
Hi. Könnt Ihr mal draufschaun, warum hier das kreissegment nicht sichtbar wird?

danke, lenny


Delphi-Quellcode:
var
  x, y, i, r, a, aStrt, aEnd, xm, ym: integer;
  f,ff:extended; // f kann in create-routine der form ausgelagert
werden
  Points: array of TPoint;
  ImgX,ImgY:integer;
  btmpLayer:TBitmapLayer;
  Lctn: TFloatRect;
begin
  Image32_1.BeginUpdate;
  btmpLayer:=TBitmapLayer.Create(Image32_1.Layers);
  ImgX:=513;
  ImgY:=513;
  aStrt:=0;
  aEnd:=30;
  xm:=256;
  ym:=256;
  r:=256;
  r:=230;
  a := (aEnd - aStrt);

  with Image32_1 do
   begin
    Width := ImgX;            //0-255 | 257-512//  0-254  y,x -->
    Height := ImgY;           //---------------//   |     |
              //              //0-255 | 257-512//256-511  \/
     Bitmap.Width:=Image32_1.Width;
     Bitmap.Height:=Image32_1.Height;

     Lctn.Left:=0;
     Lctn.Right:=(Image32_1.Width);
     Lctn.Bottom:=(Image32_1.Height);
     Lctn.Top:=0;
     btmpLayer.Location:=Lctn;

     end;
    with TPolygon32.create do
    begin
     Add(fixedpoint(xm,ym));
     f:=(2 * pi / 360);
     for i := 1 to a do
      begin
       ff:=((aStrt + (i - 1)) * f);
       x:=(xm + round(r * cos(ff)));
       y:=(ym - round(r * sin(ff)));
         Add(fixedpoint(x,y));
      end;
             DrawFill(btmpLayer.Bitmap,clred32);
         free;
    end;
    Image32_1.EndUpdate;
    Image32_1.Changed;
                Image32_1.Layers[0].BringToFront;
            Image32_1.Refresh;

end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:30 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz