各位大侠:
小弟的代码如下:
procedure TFormWork.Edit11Exit(Sender: TObject);
var
DC: HDC;
image0:Timage;
begin
BarCodeCtrl1.Value:=edit11.Text;
image0:=Timage.Create(self);
with Image0, Picture do begin
Picture := nil;
Bitmap.Width := BarCodeCtrl1.ClientWidth;
Bitmap.Height := BarCodeCtrl1.ClientHeight;
DC := GetDC( BarCodeCtrl1.Handle );
try
BitBlt( Bitmap.Canvas.Handle, 0, 0,
BarCodeCtrl1.ClientWidth,
BarCodeCtrl1.ClientHeight, DC, 0, 0, SRCCOPY );
finally
ReleaseDC( BarCodeCtrl1.Handle, DC );
end;{try..finally..}
end;{with Image1, Picture do}
ModelImage.Canvas.StretchDraw(rect(202,540,822,589),image0.picture.graphic);
ModelImage.Picture.SaveToFile('c:\1111.bmp');
end;
问题是:ModelImage.Canvas.StretchDraw(rect(202,540,822,589),image0.picture.graphic);这个语句为什么不能把rect(202,540,822,589)这个区域全部填满,而只填了一些地方!或者还有别的更好的方法吗?
小弟的代码如下:
procedure TFormWork.Edit11Exit(Sender: TObject);
var
DC: HDC;
image0:Timage;
begin
BarCodeCtrl1.Value:=edit11.Text;
image0:=Timage.Create(self);
with Image0, Picture do begin
Picture := nil;
Bitmap.Width := BarCodeCtrl1.ClientWidth;
Bitmap.Height := BarCodeCtrl1.ClientHeight;
DC := GetDC( BarCodeCtrl1.Handle );
try
BitBlt( Bitmap.Canvas.Handle, 0, 0,
BarCodeCtrl1.ClientWidth,
BarCodeCtrl1.ClientHeight, DC, 0, 0, SRCCOPY );
finally
ReleaseDC( BarCodeCtrl1.Handle, DC );
end;{try..finally..}
end;{with Image1, Picture do}
ModelImage.Canvas.StretchDraw(rect(202,540,822,589),image0.picture.graphic);
ModelImage.Picture.SaveToFile('c:\1111.bmp');
end;
问题是:ModelImage.Canvas.StretchDraw(rect(202,540,822,589),image0.picture.graphic);这个语句为什么不能把rect(202,540,822,589)这个区域全部填满,而只填了一些地方!或者还有别的更好的方法吗?
StretchDraw后,刷一次ModelImage 看看