我想利用endialog组件选择JPEG格式的图片,然后在Tlistview组件中显示为背景,代码怎么写呢?
var
bit:Tbitmap;
x,y,w,h:integer;
tj:tjpegimage;
begin
try
tj:=tjpegimage.create;
tj.loadfromfile(filename);//filename为你打开文件的文件名;
bit:=tbitmap.Create;
bit.assign(tj);
tj.free;
w:=bit.Width;
h:=bit.Height;
y:=0;
while y<h do
begin
x:=0;
while x<w do
begin
listview1.Canvas.Draw(x,y,bit);
inc(x,w);
end;
inc(y,h);
end;
finally
bit.FreeImage;
bit.Free;
tj.free;
end;
end;}