我以前做过,这个可以做一个对象,这个对像要能保存你的图像,我还是给你一点代码,不过分太少,先给一半
unit TextRich;
interface
uses windows, graphics, math,dialogs,sysutils;
type
//TRichTextDraw = class;
TPointArry = array[0..3] of TPoint;
TRichTextDraw = class(TObject)
private
FCanvas : TCanvas; //对象的Canvas
FCoordinate : TPoint; //起始坐标(左上角)
FFont : TFont; //字体
FScapeBetween : Integer; //字间距
FText : string; //字体
FAngle : Single; //旋转角度
FHeight : Single; //字体高度
FWidth : Single; //字体宽度
FItalic : Byte; //斜体
FUnderLine : Byte; //下划线
FActive : Boolean; //激活属性
FPoint : TPointArry; //文字区域顶角坐标
FArea : HRGN; //文字区域句柄
FSWidth : Integer; //四角方框(1/2)宽度
FAngleRad : double; //旋转角度(弧度制表示)
FScale : double; //字符宽度/间距
FCenterPoint : TPoint; //对象中心点坐标
FOldAngle : Single; //旋转前对象的角度
FRadius : Double; //对象的半径(中心到任一定点的距离)
FDropPoint : Integer;
public
property Canvas : TCanvas read FCanvas write FCanvas; //读取属性
property Coordinate : TPoint read FCoordinate write FCoordinate;
property Font : TFont read FFont write FFont;
property ScapeBetween : Integer read FScapeBetween write FScapeBetween;
property Text : string read FText write FText;
property Angle : Single read FAngle write FAngle;
property Height : Single read FHeight write FHeight;
property Width : Single read FWidth write FWidth;
property Italic : Byte read FItalic write FItalic;
property UnderLine : Byte read FUnderLine write FUnderLine;
property Active : Boolean read FActive write FActive;
property Point : TPointArry read FPoint write FPoint;
property Scale : double read FScale write FScale;
property OldAngle : Single read FOldAngle write FOldAngle;
constructor Create;
destructor Destroy; override;
procedure TextDraw;
procedure CalPoint;
procedure ReverseActive;
procedure ChangeSize(X, Y, PointNum : Integer);
procedure CalWH(DragPoint : Integer);
procedure SignCircumgyrate;
procedure DrawRect;
procedure Circumgyrate(X, Y : Integer);
function IsIn(X, Y : Integer) : Boolean;
function IsOnPane(X, Y : Integer) : Integer;
function IsInCircularity(X, Y : Integer) : Boolean;
function CalAngle(X, Y : Integer) : Single;
end;
implementation