BGRA Simple Fast Triangle lazarus / 39-Graphics ---------------------------------------------------------------------- SandyG · 2024-06-26 23:21 Found some routines to draw triangles but not sure if the fastest way to draw a simple filled triangle being used as an Analog Gauge Pointer. I tried these -     procedure FillTriangleLinearColor(pt1,pt2,pt3: TPointF; c1,c2,c3: TBGRAPixel); override;     procedure FillTriangleLinearColorAntialias(pt1,pt2,pt3: TPointF; c1,c2,c3: TBGRAPixel); override; But really just need a simple filled Antialiased Triangle as these are a bit overkill. Whats a light weight way to do this or are these the way to go. Sandy ---------------------------------------------------------------------- jamie · 2024-06-27 00:13 if you are dealing with basic direction arrows then using a ImagelIst is much easier and faster. ---------------------------------------------------------------------- SandyG · 2024-06-27 00:43 More of a pointer on a gauge, needs to be able to change size, length and a few other parameters. It may not be worth messing with it as it's a bit tricky to rotate a polygon around a center, more math  Just looking to do some additional styles for the pointer on the updated analog gauge. Pic of the progress. ---------------------------------------------------------------------- circular · 2024-06-29 07:29 Quote from: SandyG on June 27, 2024, 01:21:19 amFound some routines to draw triangles but not sure if the fastest way to draw a simple filled triangle being used as an Analog Gauge Pointer. I tried these -     procedure FillTriangleLinearColor(pt1,pt2,pt3: TPointF; c1,c2,c3: TBGRAPixel); override;     procedure FillTriangleLinearColorAntialias(pt1,pt2,pt3: TPointF; c1,c2,c3: TBGRAPixel); override; But really just need a simple filled Antialiased Triangle as these are a bit overkill. Whats a light weight way to do this or are these the way to go. Sandy Hi Sandy, These routines provide a trilinear gradient, that's why there are specific versions for triangles. If you're looking for a solid fill, you can use FillPolygon / FillPolygonAntialias functions. For transformations, there are some tools to make it easier. With BGRATransform, you have affine matrices that can transform TPointF coordinates. Alternatively, you can use Canvas2D to apply transformations to your drawings. Warm regards ---------------------------------------------------------------------- SandyG · 2024-07-01 18:48 I will have a look. Might be better to use Canvas2D Drawing as it seems easier to draw from points then to find centers of a polygon. I'm almost at the point where I can add some of the fancy looking features, but still have to get some more of the basics done on the Analog Gauage, added a lot of stuff but need to get it organized before I add the fluff Thanks Sandy