下面这段动态创建的图形,当图形画好后,如何在图形上响应鼠标双击动作,将保存文件的界面动态生成,并将图形保存下来.
procedure DrawTriChart(const ACaption, APrompt: string; m:integer;Qmat:matrixxy;mc:matrixsi);
var
Form: TForm;
Image: TImage;
DialogUnits: TPoint;
SavePicture: TSaveDialog;begin
Form := TForm.Create(Application);
with Form do
try
Canvas.Font := Font;
DialogUnits := GetAveCharSize(Canvas);
BorderStyle := bsDialog;
Canvas.font.size:=12;
Caption := ACaption;
ClientWidth := MulDiv(350, DialogUnits.X, 4);
ClientHeight :=MulDiv(250, DialogUnits.Y, 8);
Position := poScreenCenter;
image:= TImage.Create(Form);
with Image do
begin
Parent := Form;
Align:=alClient;
Autosize:=true;
width:=form.width;
height:=form.height;
Canvas.moveto(100,200);
Canvas.lineto(300,500);
... ...
end;
if ShowModal = mrOk then
begin
Image.FreeOnRelease;
end;
finally
Form.Free;
end;
end;
procedure DrawTriChart(const ACaption, APrompt: string; m:integer;Qmat:matrixxy;mc:matrixsi);
var
Form: TForm;
Image: TImage;
DialogUnits: TPoint;
SavePicture: TSaveDialog;begin
Form := TForm.Create(Application);
with Form do
try
Canvas.Font := Font;
DialogUnits := GetAveCharSize(Canvas);
BorderStyle := bsDialog;
Canvas.font.size:=12;
Caption := ACaption;
ClientWidth := MulDiv(350, DialogUnits.X, 4);
ClientHeight :=MulDiv(250, DialogUnits.Y, 8);
Position := poScreenCenter;
image:= TImage.Create(Form);
with Image do
begin
Parent := Form;
Align:=alClient;
Autosize:=true;
width:=form.width;
height:=form.height;
Canvas.moveto(100,200);
Canvas.lineto(300,500);
... ...
end;
if ShowModal = mrOk then
begin
Image.FreeOnRelease;
end;
finally
Form.Free;
end;
end;
解决方案 »
- 怎样修改edit边框颜色呀?
- 这样写有问题么?(急)
- dspack 播放RMVB格式问题特别多
- Rave问题,怎么把报表文件打包到EXE文件 谢谢 在线等
- Indy 9自带demo "DNSResolver Client" 编译出错,但其他的demo都可以,真是怪事。请大家帮忙看一下
- 关于读取字段中分隔符数据问题
- 请教高手:关于获取PSafeArray数据的问题
- 在dbgrid中,怎样象LISTVIEW一样在最前列的前面显示一图标,在线等待。。。
- 关于光盘问题
- 报表设计的问题
- 一个简单的问题,-----(fastreport)————在线守侯
- fastReport问题。如何动态设置MEMO的DISPLAYFORMAT啊?为什么TfrMemoView(frRep.FindObject('Memo2')).DisplayFormat := '###,###,###,##
楼上讲的都能做得,只是不知如何在图形上双击鼠标,并动态创建TSaveDialog,然后保存图形到一个指定文件名的文件中.