halcon-dev_set_part修改图像的显示区域

在HDevelop中

ma.jpg

halcon-dev_set_part修改图像的显示区域

 

 

dev_open_window (0, 0, 500, 400, 'gray', WindowHandle)
read_image (Image, 'D:/bb/tu/ma.jpg')
get_image_size (Image, Width, Height)

dev_set_part(50,150,200,250)
*修改图像在激活窗口的显示区域
*注意:图像本身没有改变
*参数1:显示区域左上角的row-y坐标
*参数2:显示区域左上角的col-x坐标
*参数3:显示区域右下角的row-y坐标
*参数4:显示区域右下角的col-x坐标


get_image_size (Image, Width1, Height1)

dev_display(Image)

halcon-dev_set_part修改图像的显示区域

 

 

在QtCreator中

    HObject  ho_Image;
    HTuple  hv_WindowHandle, hv_Width, hv_Height;
    HTuple  hv_Width1, hv_Height1;
    SetWindowAttr("background_color","gray");
    OpenWindow(0,0,500,400,0,"visible","",&hv_WindowHandle);
    HDevWindowStack::Push(hv_WindowHandle);

    ReadImage(&ho_Image, "D:/bb/tu/ma.jpg");
    GetImageSize(ho_Image, &hv_Width, &hv_Height);
    int Width=hv_Width.I();
    qDebug()<<"Width="<<Width;
    int Height=hv_Height.I();
    qDebug()<<"Height="<<Height;

    SetPart(hv_WindowHandle,50, 150, 200, 250);
      //修改图像在激活窗口的显示区域
      //注意:图像本身没有改变
      //参数1:窗口句柄
      //参数2:显示区域左上角的row-y坐标
      //参数3:显示区域左上角的col-x坐标
      //参数4:显示区域右下角的row-y坐标
      //参数5:显示区域右下角的col-x坐标
    DispObj(ho_Image, HDevWindowStack::GetActive());
    GetImageSize(ho_Image, &hv_Width1, &hv_Height1);

    int Width1=hv_Width1.I();
    qDebug()<<"Width1="<<Width1;
    int Height1=hv_Height1.I();
    qDebug()<<"Height1="<<Height1;

halcon-dev_set_part修改图像的显示区域

 

 

 

 

 

 

 

halcon-dev_set_part修改图像的显示区域

相关文章:

  • 2021-12-04
  • 2021-04-20
  • 2021-05-20
  • 2021-12-26
  • 2022-12-23
  • 2021-11-21
  • 2021-10-05
  • 2021-12-16
猜你喜欢
  • 2021-11-07
  • 2022-02-08
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案