再学GDI+[85]: TGPImage(5) - RotateFlip - 旋转与镜像 - Delphi教程 - 编程入门网
再学GDI+[85]: TGPImage(5) - RotateFlip - 旋转与镜像
本例效果图:
代码文件:unit Unit1;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdC
TForm1 = class(TForm)
ListBox1: TListB
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
Form1: TForm1;
implementation
{$R *.dfm}
uses GDIPOBJ, GDIPAPI;
procedure TForm1.FormCreate(Sender: TObject);
ListBox1.Align := alR
with ListBox1.Items do
Add('RotateNoneFlipNone');
Add('Rotate90FlipNone');
Add('Rotate180FlipNone');
Add('Rotate270FlipNone');
Add('RotateNoneFlipX');
Add('Rotate90FlipX');
Add('Rotate180FlipX');
Add('Rotate270FlipX');
procedure TForm1.FormPaint(Sender: TObject);
img: TGPI
g := TGPGraphics.Create(Self.Canvas.Handle);
img := TGPImage.Create('C:\temp\test.jpg');
img.RotateFlip(TRotateFlipType(ListBox1.ItemIndex));
g.DrawImage(img, 4, 4, img.GetWidth, img.GetHeight);
procedure TForm1.ListBox1Click(Sender: TObject);GDI+ 学习记录(31): 图像颜色变换(TGPImageAttributes)
GDI+ 学习记录(31): 图像颜色变换(TGPImageAttributes)
发布时间: 16:07:06
编辑:www.fx114.net
本篇文章主要介绍了"GDI+ 学习记录(31): 图像颜色变换(TGPImageAttributes)",主要涉及到GDI+ 学习记录(31): 图像颜色变换(TGPImageAttributes)方面的内容,对于GDI+ 学习记录(31): 图像颜色变换(TGPImageAttributes)感兴趣的同学可以参考一下。
//添加颜色变换
uses GDIPAPI, GDIPOBJ;
procedure TForm1.FormPaint(Sender: TObject);
imgAtt: TGPImageA
ColorMatrix: TColorMatrix = (
(1.0, 0.0, 0.0, 0.0, 0.0),
(0.0, 1.0, 0.0, 0.0, 0.0),
(0.0, 0.0, 1.0, 0.0, 0.0),
(0.0, 0.0, 0.0, 1.0, 0.0),
(1.0, 0.0, 0.0, 0.0, 1.0));
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:\temp\test.png'); {测试文件要存在}
imgAtt := TGPImageAttributes.C
imgAtt.SetColorMatrix(colorMatrix, ColorMatrixFlagsDefault, ColorAdjustTypeDefault);
g.DrawImage(
MakeRect(0,0,img.GetWidth,img.GetHeight),
img.GetWidth,
img.GetHeight,
UnitPixel,
本文标题:
本页链接: //正常显示, 没有变换uses GDIPAPI, GDIPOBJ;
procedure TForm1.FormPaint(Sender: TObject);
img: TGPI
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:temptest.png'); {测试文件要存在}
g.DrawImage(img, 0, 0, img.GetWidth, img.GetHeight);
//: //添加颜色变换uses GDIPAPI, GDIPOBJ;
procedure TForm1.FormPaint(Sender: TObject);
img: TGPI
imgAtt: TGPImageA
/> 这个话题还有很多内容, 先弄这个例子算是给 M. Rokkaei 的回答.再学GDI+[60]: TGPGraphics.SetSmoothingMode - 绘图质量
本例效果图:
代码文件:unit Unit1;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdC
TForm1 = class(TForm)
ListBox1: TListB
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
Form1: TForm1;
implementation
{$R *.dfm}
uses GDIPOBJ, GDIPAPI;
procedure TForm1.FormCreate(Sender: TObject);
ListBox1.Align := alR
with ListBox1.Items do
Add('SmoothingModeInvalid ');
Add('SmoothingModeDefault ');
Add('SmoothingModeHighSpeed ');
Add('SmoothingModeHighQuality');
Add('SmoothingModeNone ');
Add('SmoothingModeAntiAlias ');
procedure TForm1.FormPaint(Sender: TObject);
g := TGPGraphics.Create(Canvas.Handle);
p := TGPPen.Create(aclRed, 2);
g.SetSmoothingMode(ListBox1.ItemIndex - 1);
g.DrawEllipse(p, 10, 10, ClientWidth - ListBox1.Width - 20, ClientHeight - 20);
g.DrawLine(p, 0, 0, ClientWidth - ListBox1.Width, ClientHeight);
g.DrawLine(p, ClientWidth - ListBox1.Width, 0, 0, ClientHeight);
procedure TForm1.ListBox1Click(Sender: TObject);
最新教程周点击榜
微信扫一扫}