package com.ycl.api.YS.playback.config; import com.sun.jna.Native; import com.ycl.api.YS.NetDemo; import com.ycl.api.YS.lib.NetDEVSDKLib.NETDEV_RECT_S; import javax.swing.*; import java.util.InputMismatchException; /** * * @introduction PlayBack DigitalZoom * @description Support NVR/VMS */ public class PlayBackDigitalZoom { /** * * @introduction Set the playback digitalzoom * @description Calling the interface of NETDEV_SetDigitalZoom to set the digitalZoom, * the parameter should between 0 and 10000 * */ public static void setPlayBackDigitalZoom() { if(null == NetDemo.lpUserID) { JOptionPane.showMessageDialog(null, "Please Login device first. error code"+NetDemo.netdevsdk.NETDEV_GetLastError()); return; } int dwLeft=0; int dwTop=0; int dwRight=0; int dwBottom=0; try { dwLeft=Integer.parseInt(NetDemo.jTextFieldPlayBackDigitalZoomLeft.getText()); }catch(NumberFormatException |InputMismatchException e) { JOptionPane.showMessageDialog(null, "left parameter is null or transformation exception"); return; } if(dwLeft<0||dwLeft>10000) { JOptionPane.showMessageDialog(null, "Left parameter should beteen 0~10000"); return; } try { dwTop=Integer.parseInt(NetDemo.jTextFieldPlayBackDigitalZoomTop.getText()); }catch(NumberFormatException |InputMismatchException e) { JOptionPane.showMessageDialog(null, "Top parameter is null or transformation exception"); NetDemo.jTextFieldPlayBackDigitalZoomTop.setText(null); return; } if(dwTop<0||dwTop>10000) { JOptionPane.showMessageDialog(null, "Top parameter should beteen 0~10000"); return; } try { dwRight=Integer.parseInt(NetDemo.jTextFieldPlayBackDigitalZoomRight.getText()); } catch(NumberFormatException | InputMismatchException e) { JOptionPane.showMessageDialog(null, "Right parameter is null or transformation exception"); return; } if(dwRight<0||dwRight>10000) { JOptionPane.showMessageDialog(null, "Right parameter should beteen 0~10000"); return; } try { dwBottom=Integer.parseInt(NetDemo.jTextFieldPlayBackDigitalZoomBottom.getText()); }catch(NumberFormatException |InputMismatchException e) { JOptionPane.showMessageDialog(null, "Bottom parameter is null or transformation exception"); return; } if(dwBottom<0||dwBottom>10000) { JOptionPane.showMessageDialog(null, "Bottom parameter should beteen 0~10000"); return; } if(dwBottom