M
mylovegirl
Unregistered / Unconfirmed
GUEST, unregistred user!
保存BMP却得到一片黑
procedure TMainFrm.ToolButton9Click(Sender: TObject);
var
X,Y:integer;
begin
Bmp:=TBitmap.Create;
Bmp.Width:=Wth;
Bmp.Height:=Hgh;
Bmp.PixelFormat:=pf1bit;
for Y:=0 to Hgh-1 do
for X:=0 to Wth-1 do
begin
if S[Y,X]=1 then
Bmp.Canvas.Pixels[X,Y]:=1
else
Bmp.Canvas.Pixels[X,Y]:=0;
end;
if SavePictureDialog1.Execute then
Bmp.SaveToFile(SavePictureDialog1.filename);
procedure TMainFrm.ToolButton9Click(Sender: TObject);
var
X,Y:integer;
begin
Bmp:=TBitmap.Create;
Bmp.Width:=Wth;
Bmp.Height:=Hgh;
Bmp.PixelFormat:=pf1bit;
for Y:=0 to Hgh-1 do
for X:=0 to Wth-1 do
begin
if S[Y,X]=1 then
Bmp.Canvas.Pixels[X,Y]:=1
else
Bmp.Canvas.Pixels[X,Y]:=0;
end;
if SavePictureDialog1.Execute then
Bmp.SaveToFile(SavePictureDialog1.filename);