zw版【转发·台湾nvp系列Delphi例程】HALCON HWindowX 01
2015-10-01 19:40
543 查看
zw版【转发·台湾nvp系列Delphi例程】HALCON HWindowX 01
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
w, h : OleVariant;
mtype : OleVariant;
mode : array[0..3] of Variant;
values : OleVariant;
begin
img := CoHImageX.Create;
img.ReadImage('bk45');
img.GetImagePointer1(mtype, w, h);
HWindowX1.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowX1);
mode[0] := 'histogram';
mode[1] := Panel2.ClientHeight div 2;
mode[2] := Panel2.ClientWidth div 2;
mode[3] := 1;
values := VarArrayOf(mode);
HWindowX2.SetPart(0, 0, Panel2.ClientHeight - 1, Panel2.ClientWidth - 1);
HWindowX2.SetPaint(values);
HWindowX2.ClearWindow();
img.DispObj(HWindowX2);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
op.CloseWindow(HWindowX1.HalconID);
op.CloseWindow(HWindowX2.HalconID);
end;
procedure TForm1.FormShow(Sender: TObject);
begin
ShowMessage('Delphi '+ IntToStr(Sizeof(Pointer)*8));
op := CoHOperatorSetX.Create;
op.SetCheck('~father');
HWindowX1 := CoHWindowX.Create();
HWindowX2 := CoHWindowX.Create();
HWindowX1.OpenWindow(0,0,Panel1.ClientWidth,Panel1.ClientHeight,Int64(Panel1.Handle),'visible','');
HWindowX2.OpenWindow(0,0,Panel2.ClientWidth,Panel2.ClientHeight,Int64(Panel2.Handle),'visible','');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
w, h : OleVariant;
mtype : OleVariant;
mode : array[0..3] of Variant;
values : OleVariant;
begin
img := CoHImageX.Create;
img.ReadImage('bk45');
img.GetImagePointer1(mtype, w, h);
HWindowX1.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowX1);
mode[0] := 'histogram';
mode[1] := Panel2.ClientHeight div 2;
mode[2] := Panel2.ClientWidth div 2;
mode[3] := 1;
values := VarArrayOf(mode);
HWindowX2.SetPart(0, 0, Panel2.ClientHeight - 1, Panel2.ClientWidth - 1);
HWindowX2.SetPaint(values);
HWindowX2.ClearWindow();
img.DispObj(HWindowX2);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
op.CloseWindow(HWindowX1.HalconID);
op.CloseWindow(HWindowX2.HalconID);
end;
procedure TForm1.FormShow(Sender: TObject);
begin
ShowMessage('Delphi '+ IntToStr(Sizeof(Pointer)*8));
op := CoHOperatorSetX.Create;
op.SetCheck('~father');
HWindowX1 := CoHWindowX.Create();
HWindowX2 := CoHWindowX.Create();
HWindowX1.OpenWindow(0,0,Panel1.ClientWidth,Panel1.ClientHeight,Int64(Panel1.Handle),'visible','');
HWindowX2.OpenWindow(0,0,Panel2.ClientWidth,Panel2.ClientHeight,Int64(Panel2.Handle),'visible','');
end;
相关文章推荐
- zw版【转发·台湾nvp系列Delphi例程】HALCON Cast 使用方式
- zw版【转发·台湾nvp系列Delphi例程】CheckDifference1
- zw版【转发·台湾nvp系列Delphi例程】HALCON InpaintingCt2
- zw版【转发·台湾nvp系列Delphi例程】HALCON InpaintingCt1
- zw版【转发·台湾nvp系列Delphi例程】HALCON CropPart
- zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger1-4
- zw版【转发·台湾nvp系列Delphi例程】HALCON TestObjDef
- zw版【转发·台湾nvp系列Delphi例程】HALCON DispCross
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetLineStyle2
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetLineStyle1
- zw版【转发·台湾nvp系列Delphi例程】HALCON GenGridRegion
- zw版【转发·台湾nvp系列Delphi例程】HALCON AffineTransRegion
- zw版【转发·台湾nvp系列Delphi例程】HALCON AffineTransImage
- zw版【转发·台湾nvp系列Delphi例程】HALCON OverpaintRegion2
- zw版【转发·台湾nvp系列Delphi例程】HALCON OverpaintRegion1
- zw版【转发·台湾nvp系列Delphi例程】HALCON RegionToBin2
- zw版【转发·台湾nvp系列Delphi例程】HALCON RegionToBin1
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetGray
- zw版【转发·台湾nvp系列Delphi例程】HALCON color_fuses2
- zw版【转发·台湾nvp系列Delphi例程】HALCON color_fuses1