There is lazarus.svg (lazarus/1.4RC2/images/icons/lazarus.svg),
I am trying to show it on canvas.
But it does not work. Picture is spiky.
May be I am doing something wrong?
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
BGRABitmap,BGRASVG,BGRAUnits;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
BgraBitmap: TBGRABitmap;
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
BgraSvg: TBGRASVG;
begin
BgraBitmap := TBGRABitmap.Create;
BgraBitmap.SetSize(600,600);
BgraBitmap.Bitmap.Canvas.FillRect(0,0,600,600);
BgraSvg := TBGRASVG.Create(600,600,cuPixel);
BgraSvg.LoadFromFile('lazarus.svg');
BgraSvg.Draw(BgraBitmap.Canvas2D,0,0, cuPixel);
BgraSvg.Destroy;
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
BgraBitmap.Draw(Canvas,0,0,True);
end;
end.
Could someone give a correct example?