I'm currently working on a logistics application. With Delphi XE8 and TMS Maps. Works great, but I have a problem with markers generated in the program.
The difficulty I'm having is that the markers are generated as desired except that I have a clFuchsia rectangle around each marker. See the picture below. Maybe someone can give me a hint how to make this Fuchsia area transparent. Thanks in advance HeWy
And here my Marker generator function:
Function tMarkerUtils.GenerateTriMarker(aColor: tColor): string;
var MarkerImage: TImage;
TransparentColor: TColor;
Points: array of TPoint;
begin
MarkerImage:= TImage.Create(nil);
try
MarkerImage.Width:= 55;
MarkerImage.Height:= 30;
MarkerImage.Picture:=nil;
TransparentColor := clFuchsia; // Background color
MarkerImage.Canvas.Brush.Style := bsClear;
MarkerImage.Canvas.Brush.Color:= TransparentColor;
MarkerImage.Picture.Bitmap.TransparentColor := TransparentColor;
MarkerImage.Picture.Bitmap.Transparent:= true;
MarkerImage.Canvas.FillRect(Rect(0, 0, MarkerImage.Width, MarkerImage.Height));
SetLength(Points, 3);
Points[0] := Point(5, 5);
Points[1] := Point(35, 5);
Points[2] := Point(20, 20);
MarkerImage.Canvas.Pen.Width := 2;
MarkerImage.Canvas.Pen.Color := clBlack;
MarkerImage.Canvas.Brush.Color := aColor;
MarkerImage.Canvas.Polygon(Points);
Result:= GetBase64Image(MarkerImage);
finally
MarkerImage.Free;
end;
end;