Can Only modify an image if it contains a bitmap
procedure TForm1.btn1Click(Sender: TObject);
var
newbmp: TBitmap;
i,j,k,bmpheight,bmpwidth:integer;
xgroup,xcount:integer;
begin
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
case RadioGroup1.ItemIndex of
0: begin //由左向右推拉效果
for i:=0 to bmpwidth do
begin
newbmp.Canvas.CopyRect(Rect(0,0,i,bmpheight),
image1.Canvas,Rect(bmpwidth-i,0,bmpwidth,bmpheight));
form1.Canvas.Draw(0,0,newbmp); end;
end;
1: begin //由右向左推拉效果
for i:=0 to bmpwidth do
begin
newbmp.Canvas.CopyRect(Rect(bmpwidth-i,0,bmpwidth,bmpheight),
image1.Canvas,Rect(0,0,i,bmpheight));
form1.Canvas.Draw(0,0,newbmp);
end;
end;
end;
newbmp.free;
end;
运行到红字部分就报错了 怎么回事啊,我插入的jpg图或者bmp图都没用啊