twain

Create and Save a Bitmap from an IntPtr c#

て烟熏妆下的殇ゞ 提交于 2019-12-12 04:34:52
问题 In my application I scan an image from a TWAIN device, then, I need to save this image to a local disk. All I have is an IntPtr that references the image byte data array. How can I create a Bitmap object using the IntPtr value? I tried with: Bitmap _img = new Bitmap(2450, 2450, 2452, PixelFormat.Format8bppIndexed, pixptr); _img.Save("c:\\1.Jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); This saves the image, but the image is never the same as I scanned. Any help? 来源: https://stackoverflow

Installing Twain Module on Python 3.4 on Windows

允我心安 提交于 2019-12-12 03:22:26
问题 I followed this steps but got an error message : C:\Users\PB>pip install twain --no-compile Downloading/unpacking twain Could not find any downloads that satisfy the requiremen Cleaning up... No distributions at all found for twain Storing debug log for failure in C:\Users\PB\pip\pip.log I researched and found a solution and try this command: pip install twain == 1.0.5 --allow-unverified twain and got an error message : Exception: Traceback (most recent call last): File "C:\Python3.4\lib\site

specific area scanning by Delphi twain

柔情痞子 提交于 2019-12-11 22:15:15
问题 How i can determine the x,y start and the x,y end of scanning using the Delphi twain library ? Also How i can set dpi for scan a document. Thanks. 回答1: AFAIK, for setting a region to be scanned, you can use TTwainSource.SetImageLayoutFramework method. TDelphiTwain.Source returns available Twain sources. For DPI, I guess you should first set CapUnits to tuInches using TTwainSource.SetICapUnits method. Then you can set DPI by calling TTwainSource.SetIXResolution and TTwainSource.SetIYResolution

Acquire Images in java using TWAIN

帅比萌擦擦* 提交于 2019-12-11 19:47:07
问题 I am using Twain to Capture Images in java. Its Working Fine as Seperate Application. And when i tried it to integrate with my project its giving me a problem. Its running but printers Properties Window is not shown at the Top of My Frame... Pls help.... 回答1: perhaps you can share your codes here for reference. To use TWAIN in Java, here is a off-the-shelf SDK you can take a look. 来源: https://stackoverflow.com/questions/10664390/acquire-images-in-java-using-twain

Adobe AIR Native Extension TWAIN Image Scanner

狂风中的少年 提交于 2019-12-11 19:17:43
问题 Currently I am working on Adobe AIR Native extension which gives possibilities to simple manipulate image scanner using TWAIN. I use CTwain class found at http://www.codeproject.com/Articles/296/A-C-Wrapper-for-TWAIN When i use this class in Windows Application (.exe) it works as expected, but in dll (which i need to create ane file) it crashes when Twain Device UI is closing (when scan complete or by clicking Cancel button) I thing the problem is somewhere in DllMain.cpp file (possibly

Using Twain Module in Python

喜欢而已 提交于 2019-12-11 12:10:50
问题 I have 64 bit Windows and 64 bit Python . In the twain docs said : supports only 32 bit . I have used twain data source to install my 64 bit machine and used this code to connect scanner device: import twain sm = twain.SourceManager(0) ss = sm.OpenSource() ss.RequestAcquire(0,0) rv = ss.XferImageNatively() if rv: (handle, count) = rv twain.DIBToBMFile(handle, 'image.bmp') When I run the app. a windows opens like : so why this window is empty . The scanner device will show in this window ? 来源:

Are memory issues common when scanning 2400 DPI pictures with TWAIN?

和自甴很熟 提交于 2019-12-11 10:06:43
问题 I'm using twaindotnet to scan an image with 2400 DPI. Whenever I scan a full page in color I get a message that there is not enough memory to perform this action. I tried it on a different computer with around 4 GB of ram and got the same error message. If I scan the image as black and white or gray-scale I don't get any error and everything is working fine. Is that a problem that is related to the scanner driver (Canon 9000F) or is this a general TWAIN problem? 回答1: Looks like that Twain

Is there anyway to install twain module in python 3

亡梦爱人 提交于 2019-12-11 01:46:12
问题 I want to install the Python TWAIN module in Python 3. But in the docs it says: Python versions 2.1 through 2.5 are supported. Can I convert it using 2to3 ? 回答1: Use past module which provides an experimental translation package to help with importing and using old Python 2 modules in a Python 3 environment. So install your package with pip pip3 install twain --no-compile # to ignore SyntaxErrors And use next code to import twain in your python3 code : from past import autotranslate

结合WebSocket,实现远程二维码生成应用

▼魔方 西西 提交于 2019-12-10 04:10:03
在上一篇文章中介绍了通过WebSocket实现服务端和客户端的图像传输。基于这个实现,可以把二维码生成器放在服务端,轻松实现远程解决方案。 参考原文: Barcode Generator with HTML5 WebSocket 准备工作 下载 Barcode SDK for .NET 阅读 - 通过WebSocket连接,实现Image从服务器到浏览器的传输 二维码远程生成 在工程中添加DynamicBarcode.dll,在属性中设置Copy to Output Directory为Copy always,这样dll就会和exe文件在同一个目录下。 添加一张背景图。对收到的消息编码。通过一个接口,生成二维码,并把二维码画到背景图上。 float scale = 3; short sImageIndex = 0; dynamicDotNetTwain.MaxImagesInBuffer = 1; bool isLoaded = dynamicDotNetTwain.LoadImage("test.png"); dynamicDotNetTwain.AddBarcode(sImageIndex, Dynamsoft.DotNet.TWAIN.Enums.Barcode.BarcodeFormat.QR_CODE, message, "", 0, 0, scale);

Twain device (scanner) control in Java

巧了我就是萌 提交于 2019-12-10 00:40:06
问题 I want to scan a number of papers through Java. I found the mm's computing twain library. When I run the example TwainExample.java at the site, I receive this error. uk.co.mmscomputing.device.twain.TwainIOException: Cannot load Twain Source Manager. On the other hand, almost the same code works with ImageJ as a plugin. Yet, when I used this code by itself I still receive the same exception. I wonder why this is not working. 回答1: You can try download TWAINDSM.DLL for 64bit and put it in C: