项目 | 内容 |
---|---|
调试 | Delphi Seattle |
运行 | Win7 & iOS 9.2 |
问题描述
当需要在Bitmap.Canvas上人工绘制内容(包括图像和形状)时,遇到如下问题。
procedure TForm1.FDrawMethod1(Sender: TObject);
begin
with Image1.Bitmap do
begin
SetSize(Round(Image1.Width * Self.FScreenScaleRate),
Round(Image1.Height * Self.FScreenScaleRate));
Clear(TAlphaColorRec.Null);
Canvas.BeginScene();
try
Canvas.Fill.Kind := TBrushKind.Solid;
Canvas.Fill.Color := TAlphaColorRec.White;
Canvas.FillEllipse(TRectF.Create(5, 5, Canvas.Width-5, Canvas.Height-5), 1);
finally
Canvas.EndScene;