网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > Java
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.对等计算实践之:构建 P2P 应用程.
.Simply Singleton -- part1 By D.
.对象的创建和存在时间.
.面向方面编程AOP和JBoss(二).
.优化 Java 垃圾收集器改进系统性.
.Java SE 6中的AWT模态增强功能.
.Apache的完全安装转载.
.Java简单类型进行精确浮点数运算.
.找出正被调用的方法名.
.java中,this用途总结。。。.
.诊断和纠正 Java 程序中反复出现.
.java设计模式之Mediator.
.JDBC 入门.
.JAVA入门教程:第二章.
.逻辑“非”运算符 (!).
.Spring 2.0 M1发布了.
.java版的MD5.
.让Java动起来的脚本语言.
.怎样使用Junit Framework进行单元.
.Eclipse插件JBClipse 0.2 新版发.

如何用java编写一个扫描仪程序

发表日期:2008-1-5



  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. <BR>
  */
  
  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();
   }
  }
上一篇:IBM关于数据验证和异常处理的一些文章 人气:502
下一篇:.Net下调用SQLServer2000中存储过程 人气:1081
浏览全部Java的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐