您的位置:首页 > 其它

BGRABitmap图像操作13:标准坐标系统下像素级别例子

2016-10-06 17:17 411 查看


unit Unit1;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
BGRABitmap, BGRABitmapTypes;

type

{ TForm1 }

TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormPaint(Sender: TObject);
var image: TBGRABitmap;
begin
image := TBGRABitmap.Create(10,10);
with image.Canvas do
begin
//clear with white
brush.color := clWhite;
FillRect(0,0,image.width,image.height);
//blue ellipse with black border
brush.style := bsClear;
pen.color := clBlack;
Ellipse(0,0,9,9);
end;
// stretch the image so we can see the pixels
BGRAReplace(image,image.Resample(image.Width*10,image.Height*10,rmSimpleStretch));
image.Draw(Canvas,0,0,True);
image.free;
end;

end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  TBGRABitmap 坐标
相关文章推荐