Delphi图像处理
图像缩放是最常用的图像处理,在图像拉伸和取得图像略图中都要用到。图像缩放质量的好坏与图像像素插值方式有关,本文定义了常用的3种插值方式,即临近插值、线性插值和双立方插值方式:
type
// 插值方式: 缺省(线性插值),临近,线性,双立方
TInterpolateMode = (imDefault, imNear, imBilinear, imBicubic);
具体的缩放及其用到的插值过程代码如下:
过程定义:
// 设置双立方插值的斜率。缺省值为-0.75
procedure SetBicubicSlope(const Value: Single);
// 缩放图像,IpMode插值方式
procedure ImageScale(Dest: TImageData; const Source: TImageData;
IpMode: TInterpolateMode = imDefault); overload;
// Source分别按比例ScaleX和ScaleY缩放到Dest的(x,y)坐标,IpMode插值方式
procedure ImageScale(Dest: TImageData; x, y: Integer; const Source: TImageData;
ScaleX, ScaleY: Single; IpMode: TInterpolateMode = imDefault); overload;
// TGraphic对象缩放到Dest
procedure ImageScale(Dest: TImageData; const Source: TGraphic;
IpMode: TInterpolateMode = imDefault); overload;
procedure ImageScale(Dest: TImageData; x, y: Integer; const Source: TGraphic;
ScaleX, ScaleY: Single; IpMode: TInterpolateMode = imDefault); overload;
// TGpBitmap对象缩放到Dest
procedure ImageScale(Dest: TImageData;
const Source: TGpBitmap; IpMode: TInterpolateMode = imDefault); overload;
procedure ImageScale(Dest: TImageData; x, y: Integer;
const Source: TGpBitmap; ScaleX, ScaleY: Single;
IpMode: TInterpolateMode = imDefault); overload;
实现代码:
type
TInterpolateProc = procedure;
var
BicubicTable: Pointer;
BicubicSlope: Single;
BilinearTable: Pointer;
(*****************************************************************************
* typedef UINT ARGB *
* ARGB GetBilinearColor(int x(*256), int y(*256), void* Scan0, UINT Stride) *
* *
* int x0 = x / 256
相关文档:
常用控件命名前缀
控件类名
前缀
TForm等窗体类
frm
TButton, TSpeedButton等所有的按钮类
btn
TCheckBox等所有的检查框
chk
TRadioButton单选按钮类
rdo
TListBox等所有的列表框类
lst
TPanel等所有的面板类
pnl
TLabel, TStaticText等所有用来显示的标签类
lbl
TE ......
在DELPHI为编程者提供了一个灵活的绘图场所,即本文所述的
CANVAS类,在DELPHI中的很多控件都具有此属性,使编程者可以
在这些的控件的表面随心所欲的绘图,这对完善用户界面或者制
作一些屏幕特技都有着非凡的作用,下面举例说明几种特殊屏幕
......
这里先说说两个概念:Theme(主题)和 Visual Style 。Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpaper、Cursors、Fonts、Sounds 、Icons 等的设置值集合。Visual Style 在 Windows XP 中才被引入,Visual Style 规定了 Contorls 的外观,另外还包括使用这些外观的一套 API ......
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/maozefa/archive/2009/10/28/4737584.aspx
图像缩放是最常用的图像处理,在图像拉伸和取得图像略图中都要用到。图像缩放质量的好坏与图像像素插值方式有关,本文定义了常用的3种插值方式,即临近插值、线性插值和双立方插值方式:
view plaincopy to clipboardpr ......