3个回答
展开全部
TMyComponent = class(TComponent)
private
FPicture: TPicture;
procedure SetPicture(Value: TPicture);
published
property Picture: TPicture read FPicture write SetPicture;
//....
end;
implementation
{$R *.dfm}
procedure TMyComponent.SetPicture(Value: TPicture);
begin
FPicture.Assign(Value);
end;
private
FPicture: TPicture;
procedure SetPicture(Value: TPicture);
published
property Picture: TPicture read FPicture write SetPicture;
//....
end;
implementation
{$R *.dfm}
procedure TMyComponent.SetPicture(Value: TPicture);
begin
FPicture.Assign(Value);
end;
展开全部
首先在public里定义一个picture类型b2:TImage;
在某种情况下产生一个图片,例如按下某个按钮
procedure Tform1.Button1onClick(Sender: TObject);
begin
b2:=TImage.Create(Application.MainForm);//产生picture
b2.Parent:=panel1;//放置的位置
b2.Picture.Assign(b1.Picture);//显示的图片和b1一样,也可以是电脑里,修改路径就行了
end;
在某种情况下产生一个图片,例如按下某个按钮
procedure Tform1.Button1onClick(Sender: TObject);
begin
b2:=TImage.Create(Application.MainForm);//产生picture
b2.Parent:=panel1;//放置的位置
b2.Picture.Assign(b1.Picture);//显示的图片和b1一样,也可以是电脑里,修改路径就行了
end;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Property myPicture:TPicture read FValue wirte FValue;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询