麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

如何用java編寫掃描儀程序

2019-11-18 13:13:49
字體:
來源:轉載
供稿:網友

  Q:我想用java開發一個程序,直接從掃描儀獲得掃描數據,然后上載到服務器上,這樣的程序需要利用那些知識點(有關Java)?
  
  RE:
  javatwain may be a powerful solution,you can go to www.gnome.sk to download the newest package.
  JavaTwain version 5.1 is a part of the Morena 6.0 Framework now.
  
  below is an simple example:
  /*
  * $Id: ExampleShow.java,v 1.5 2002/07/15 13:48:55 mmotovsk EXP $
  *
  * Copyright (c) 1999-2002 Gnome spol. s r.o. All Rights Reserved.
  *
  * This software is the confidential and PRoprietary information of
  * Gnome spol. s r.o. You shall not disclose sUCh Confidential
  * Information and shall use it only in accordance with the terms
  * of the license agreement you entered into with Gnome.
  */
  
  // JavaTwain package version 5.1
  
  /**
  ExampleShow demonstrates how to scan an image using defaults
  from the Twain source.

  */
  import java.awt.*;
  import java.awt.event.*;
  import SK.gnome.twain.*;
  
  public class ExampleShow extends Frame
  { Image image;
  public void paint(Graphics g)
  { if (null!=image)
  g.drawImage(image, 0, 0, this);
  }
  
  WindowListener windowAdapter=new WindowAdapter()
  { public void windowClosing(WindowEvent e)
  { System.exit(0);
  }
  };
  
  public ExampleShow()
  { try
  { addWindowListener(windowAdapter);
  setTitle("ExampleShow Frame application");
  // Open TWAIN select source dialog box
  // and initialize the source selected by the user.
  TwainSource source=TwainManager.selectSource(null);
  image=Toolkit.getDefaultToolkit().createImage(source);
  // wait for the image to be completed
  MediaTracker tracker=new MediaTracker(this);
  tracker.addImage(image, 0);
  // this is the moment the scanner user interface pops up
  System.err.println("Start loading image ...");
  try
  { tracker.waitForAll();
  }
  catch (InterruptedException e)
  { System.err.println("Image loading was interrupted!");
  e.printStackTrace();
  }
  tracker.removeImage(image);
  System.err.println("Image loaded ...");
  setSize(image.getWidth(this), image.getHeight(this));
  setVisible(true);
  TwainManager.close();
  }
  catch (TwainException e)
  { e.printStackTrace();
  }
  }
  
  public static void main(String[] args)
  { new ExampleShow();
  }
  }

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 国产亚洲黑人性受xxxx精品 | 日韩 综合 | 日本一区二区视频在线观看 | 国产最新网站 | 欧美另类69xxxxx 视频 | 日韩字幕| 九九热精品在线播放 | 精品一区二区在线播放 | 黄色二区三区 | 欧美爱爱视频网站 | 亚洲网站在线观看视频 | 欧美 亚洲 激情 | 亚洲精品aa | 亚洲精品一区二区三区免 | 精品久久久久久久久久久久久 | 久草高清视频 | 在线成人一区 | 中文字幕综合在线观看 | 国产91九色在线播放 | 曰韩在线视频 | 日韩视频精品一区 | 亚洲伊人色欲综合网 | 精品国产一区二区三区四区在线 | 欧美成年人在线视频 | 日本网站一区 | 欧美三级美国一级 | 国产精品久久二区 | 国内久久久久 | 九九午夜 | 国产毛片网站 | 黄色片网站在线免费观看 | 日韩精品网站在线观看 | 欧美四级在线观看 | 国产精品999在线观看 | 亚洲综合91 | 毛片小网站 | 亚洲视色 | 欧美成视频在线观看 | 成人性生活视频在线播放 | 九色在线78m | 国产精品成人av片免费看最爱 |