Changeset 521 for GraphicTest/Packages/bgrabitmap/bgracanvas.pas
- Timestamp:
- Apr 17, 2019, 12:58:41 AM (5 years ago)
- Location:
- GraphicTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest
- Property svn:ignore
-
old new 8 8 GraphicTest.lps 9 9 GraphicTest.dbg 10 heaptrclog.trc
-
- Property svn:ignore
-
GraphicTest/Packages/bgrabitmap/bgracanvas.pas
r494 r521 188 188 Filled: boolean = False; 189 189 Continuous: boolean = False); 190 procedure Draw(X,Y: Integer; SrcBitmap: TBGRACustomBitmap); 190 procedure Draw(X,Y: Integer; SrcBitmap: TBGRACustomBitmap); overload; 191 procedure Draw(X,Y: Integer; SrcBitmap: TBitmap); overload; 191 192 procedure CopyRect(X,Y: Integer; SrcBitmap: TBGRACustomBitmap; SrcRect: TRect); 192 193 procedure StretchDraw(DestRect: TRect; SrcBitmap: TBGRACustomBitmap; HorizFlip: Boolean = false; VertFlip: Boolean = false); … … 420 421 begin 421 422 FCustomPenStyle := DuplicatePenStyle(AValue); 422 423 if IsSolidPenStyle(AValue) then FPenStyle := psSolid else 424 if IsClearPenStyle(AValue) then FPenStyle := psClear else 425 FPenStyle := psPattern; 423 FPenStyle:= BGRAToPenStyle(AValue); 426 424 end; 427 425 428 426 procedure TBGRAPen.SetPenStyle(const AValue: TPenStyle); 429 427 begin 428 if AValue = psPattern then exit; 430 429 Case AValue of 431 430 psSolid: FCustomPenStyle := SolidPenStyle; … … 811 810 begin 812 811 if not ComputeEllipseC(x1,y1,x2,y2,cx,cy,rx,ry) then exit; 813 angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi)) ;814 angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi)) ;812 angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi)) and 65535; 813 angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi)) and 65535; 815 814 Arc65536(x1,y1,x2,y2,angle1, angle2, [aoClosePath,aoFillPath]); 816 815 end; … … 828 827 begin 829 828 if not ComputeEllipseC(x1,y1,x2,y2,cx,cy,rx,ry) then exit; 830 angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi)) ;831 angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi)) ;829 angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi)) and 65535; 830 angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi)) and 65535; 832 831 Arc65536(x1,y1,x2,y2,angle1, angle2, [aoPie,aoFillPath]); 833 832 end; … … 1121 1120 multi := TBGRAMultishapeFiller.Create; 1122 1121 multi.Antialiasing := AntialiasingMode <> amOff; 1123 with bounds do 1124 begin 1125 multi.AddPolygon([PointF(Left-0.5,Top-0.5),PointF(Right-0.5,Top-0.5), 1126 PointF(Right-0.5-width,Top-0.5+width),PointF(Left-0.5+width,Top-0.5+width), 1127 PointF(Left-0.5+width,Bottom-0.5-width),PointF(Left-0.5,Bottom-0.5)],color1); 1128 multi.AddPolygon([PointF(Right-0.5,Bottom-0.5),PointF(Left-0.5,Bottom-0.5), 1129 PointF(Left-0.5+width,Bottom-0.5-width),PointF(Right-0.5-width,Bottom-0.5-width), 1130 PointF(Right-0.5-width,Top-0.5+width),PointF(Right-0.5,Top-0.5)],color2); 1131 end; 1122 multi.AddPolygon([PointF(bounds.Left-0.5,bounds.Top-0.5),PointF(bounds.Right-0.5,bounds.Top-0.5), 1123 PointF(bounds.Right-0.5-width,bounds.Top-0.5+width),PointF(bounds.Left-0.5+width,bounds.Top-0.5+width), 1124 PointF(bounds.Left-0.5+width,bounds.Bottom-0.5-width),PointF(bounds.Left-0.5,bounds.Bottom-0.5)],color1); 1125 multi.AddPolygon([PointF(bounds.Right-0.5,bounds.Bottom-0.5),PointF(bounds.Left-0.5,bounds.Bottom-0.5), 1126 PointF(bounds.Left-0.5+width,bounds.Bottom-0.5-width),PointF(bounds.Right-0.5-width,bounds.Bottom-0.5-width), 1127 PointF(bounds.Right-0.5-width,bounds.Top-0.5+width),PointF(bounds.Right-0.5,bounds.Top-0.5)],color2); 1132 1128 multi.Draw(FBitmap); 1133 1129 multi.Free; … … 1434 1430 end; 1435 1431 1432 procedure TBGRACanvas.Draw(X, Y: Integer; SrcBitmap: TBitmap); 1433 begin 1434 FBitmap.PutImage(X,Y,SrcBitmap,dmDrawWithTransparency); 1435 end; 1436 1436 1437 procedure TBGRACanvas.CopyRect(X, Y: Integer; SrcBitmap: TBGRACustomBitmap; 1437 1438 SrcRect: TRect);
Note:
See TracChangeset
for help on using the changeset viewer.