能够正常运行还设什么断点?
还有因为有内存泄漏,修改了一下
procedure TForm1.Button1Click(Sender: TObject);
var
Res: TResourceStream;
i: Integer;
str: String;
Stream: TMemoryStream;
a_Bitmap: array [0..1] of TBitmap;
begin
Stream := TMemoryStream.Create;
a_Bitmap[0] := Image1.Picture.Bitmap;
a_Bitmap[1] := Image2.Picture.Bitmap;
for i := Low(a_Bitmap) to High(a_Bitmap) do begin
str := 'mypi' + IntToStr(i + 1);
Res := TResourceStream.Create(HInstance,str,'BMP');
Res.SaveToStream(Stream);
Stream.Seek(0,soFromBeginning);
a_Bitmap.LoadFromStream(Stream);
Res.Free;
end;
Stream.Free;
end;