求助:图片操作,谢谢 大家帮帮忙啊!我现想实现:通过多个小图标布局一张图片(背景图),操作时只要选择状态图标,选择的图标自动显示在背景图表面,也就是动态加载多个小图标了。可是我不知道如何实现??请教高手能否给点方案和代码啊??谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.用多个TImage2.响应鼠标事件时判断鼠标的位置 可以呀,指定image的autosize,top,left,heigth,width属性,当然还有picture属性 就是:ImageList1.GetIcon(Index,Image1.Picture.Icon)//INDEX为图标在imageList1中的顺序号,第一个为0,以此类推//Image1.Picture.Icon 为动态显示图标,你只需变换index的数值就可动态显示图标了 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ImgList;type TForm1 = class(TForm) ImageList1: TImageList; Image1: TImage; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } procedure SetImageBitmap(Index: Integer); public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.SetImageBitmap(Index: Integer);begin if (Index<0)or(Index>=ImageList1.Count) then Exit; //ImageList1.GetBitmap(Index,Image1.Picture.Bitmap); ImageList1.GetIcon(Index,Image1.Picture.Icon); Image1.Invalidate;end;procedure TForm1.Button1Click(Sender: TObject);begin SetImageBitmap(1);end;end. 楼上的你只显示一个图片,我可能要动态加载很多图标啊??是多个,如何实现啊??要是能动态创建多个Image就可以实现了吗?? 关于adotable问题 delphi如何实现打开网页并自动登陆 如何编写提取人对话的程序? ADOQuery1的SQL语句包含union就出错 这样的报表如何设计 如何在ADOuery里动态加入永久字段? 如何使用纪录类型 寻求兼职(成都) 一个小问题!!!!!!!!!!!!!!!! 请问在delphi6上使用opengl的glut库的问题 极度报表菜鸟求救 程序运行环境问题!请大家来帮忙。谢谢拉!着急在线等。。。。。。。。。。
2.响应鼠标事件时判断鼠标的位置
//INDEX为图标在imageList1中的顺序号,第一个为0,以此类推
//Image1.Picture.Icon 为动态显示图标,你只需变换index的数值就可动态显示图标了
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ImgList;type
TForm1 = class(TForm)
ImageList1: TImageList;
Image1: TImage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure SetImageBitmap(Index: Integer);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.SetImageBitmap(Index: Integer);
begin
if (Index<0)or(Index>=ImageList1.Count) then Exit;
//ImageList1.GetBitmap(Index,Image1.Picture.Bitmap);
ImageList1.GetIcon(Index,Image1.Picture.Icon);
Image1.Invalidate;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SetImageBitmap(1);
end;end.
要是能动态创建多个Image就可以实现了吗??