BGRABitmap图像操作14:对形状进行变换
2016-10-06 22:39
295 查看
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
BGRABitmap, BGRABitmapTypes, BGRACanvas2D;
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 bmp: TBGRABitmap;
ctx: TBGRACanvas2D;
procedure pave();
begin
ctx.fillStyle ('rgb(130,100,255)');
ctx.strokeStyle ('rgb(0,0,255)');
ctx.beginPath();
ctx.lineWidth:=2;
ctx.moveTo(5,5);ctx.lineTo(20,10);ctx.lineTo(55,5);ctx.lineTo(45,18);ctx.lineTo(30,50);
ctx.closePath();
ctx.stroke();
ctx.fill();
end;
procedure six();
var
i: Integer;
begin
ctx.save();
for i := 0 to 5 do
begin
ctx.rotate(2*PI/6);
pave();
end;
ctx.restore();
end;
begin
bmp := TBGRABitmap.Create(ClientWidth,ClientHeight,BGRA(210,210,210));
ctx := bmp.Canvas2D;
ctx.translate(80,80);
six;
bmp.Draw(Canvas,0,0);
bmp.Free;
end;
end.
相关文章推荐
- BGRABitmap图像操作14:复杂形状
- BGRABitmap图像操作10:使用Affine 变换进行纹理映射
- MATLAB图像处理_直接操作像素点进行颜色变换
- OpenGL对场景中的图像进行渲染时所执行的主要图形操作
- VC下通过直方图变换对图像进行有效增强
- iOS中使用opencv进行图像识别操作(一)步骤很多,这一篇只是讲了第一步.
- 使用OpenCV读、操作、写图像并与bash合作对某个目录下所有图像进行类似处理
- 5 用python进行OpenCV实战之图像变换2(旋转)
- 对图像进行旋转、缩放等变换
- UIGestureRecognizer对图像进行缩放、移动、旋转操作
- OpenCV----对图像进行幂次变换
- 利用Laplacian变换进行图像模糊检测
- BGRABitmap图像操作8:轴向的木质纹理
- Android 使用Matrix进行图像变换,和矩阵分析!
- 6.对图像进行ROI选取并操作
- 快速对图像的像素进行操作 opencv 实战
- python图像数组操作与灰度变换
- Python学习之使用Pillow(PIL)进行图像操作方法详解
- 用Python的PIL模块进行基本的图像操作
- 光流算法:关于根据光流(单目)或视差(双目)进行图像变换的原理