zw版【转发·台湾nvp系列Delphi例程】HALCON ZoomImageFactor
procedure TForm1.Button1Click(Sender: TObject);
var
image0, result1, result2 : HImageX;
w, h : OleVariant;
begin
image0 := CoHImageX.Create;
image0.ReadImage(‘engraved‘);
w := image0.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
image0.DispObj(HWindowXCtrl1.HalconWindow);
result1 := image0.ZoomImageFactor(0.5, 0.5, ‘constant‘);
w := result1.GetImageSize(h);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
result1.DispObj(HWindowXCtrl2.HalconWindow);
result2 := image0.ZoomImageFactor(0.5, 0.5, ‘weighted‘);
w := result2.GetImageSize(h);
HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1);
result2.DispObj(HWindowXCtrl3.HalconWindow);
end;
时间: 2024-11-03 03:44:47