Jump to content
How to Install Plugins ×

Twainable - Acquire from TWAIN sources v0.2.1 (updated 4 Oct 2010)


Recommended Posts

Updated 4 Oct 2010

The 4 October update is merely the addition of a stand-alone version of this application, for use on 64-bit Windows. For more information, continue to the bottom of this post. The original plugin hasn't changed for this release. I've decided to remove the stand-alone version to avoid further confusions.

Version 0.2.1

  • Added localization support (current only Swedish)

Version 0.2

  • Small change in the UI (new icon etc.)
  • Changed menu location from TWAIN to Tools

Version 0.1

  • First release

My first plugin! Hopefully someone finds it useful.

It's still in development (0.2.1), but it should work as expected.

Note

This plugin currently only works on 32-bit systems.

About

I wrote this effect to be able to use my "old" CanoScan LiDE 20 scanner from Paint.NET. It uses the EZTwain Classic DLL, and should be compatible with all scanners that are TWAIN-compatible.

Files included

Twainable.dll - The effect plugin (required)

EZTW32.dll - The EZTwain Classic DLL used by this plugin (required)

Twainable readme.txt - This file

sv-se.fxlang - Swedish localization

Installation

Place the files Twainable.dll and EZTW32.dll in the Effects folder of your Paint.NET installation folder.

(Optional) Placing the sv-se.fxlang file in the Effects folder will give you Swedish translation.

This plugin utilizes the plugin translation written by Simon Brown*. The file sv-se.fxlang contains translated entries for this plugin (currently only in Swedish). See Translation below if you want to translate these entries to your tongue.

The localization file isn't required by the plugin to function. If not found, it will use English as default. If you want to use it, place it in the same folder as the Twainable.dll file (that is, the Effects-folder).

*Note: the plugin translation code can be found in this forum thread:

http://forums.getpaint.net/index.php?/topic/18816-plugin-translation-scheme-including-code/

Usage

After placing both files in the Effects folder, (re-)start Paint.NET. The plugin can be found under the menu Effects->Tools->Acquire from TWAIN...

The main window consists of three buttons:

  • "Select Source..." lets you select which TWAIN-source to use
  • "Acquire to clipboard..." starts the scanner software, and stores the scanned image in the clipboard
  • "Close" closes the window

Translation

First, read the forum thread at http://forums.getpaint.net/index.php?/topic/18816-plugin-translation-scheme-including-code/ to get a better understanding on the format.

The entries that this plugin uses are the following:

<LANGCODE>:select source=<YOUR TRANSLATION>

<LANGCODE>:acquire=<YOUR TRANSLATION>

<LANGCODE>:close=<YOUR TRANSLATION>

<LANGCODE>:close window automatically=<YOUR TRANSLATION>

...where <LANGCODE> is the language code of your language (e.g. sv-se for Swedish, de for German, and so on), and <YOUR TRANSLATION> is of course the translation.

The file sv-se.fxlang contains several other entries as well, but these aren't used by this plugin.

References

EZTwain Classic DLL can be found here: http://www.dosadi.com/eztwain1.htm

Running on 64-bit systems

If you running a 64-bit system you may have come across the error message System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B). This is due to trying to run the plugin on a 64-bit system.

I've developed a stand-alone version of the plugin, for all you 64-bit users. It works in the same way, but doesn't required Paint.NET to run (it's a stand-alone, after all). Just download the "Twainable (stand-alone 0.1).zip" archive attached to this post, and read the file "Read me.txt" contained within. Removed as of 8 sep 2011.

Twainable.zip

Edited by NisseBosseLasse
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 weeks later...

Doesnt work in Win7 x64:

Datei: C:\Program Files\Paint.NET\Effects\Twainable.dll

Effektname: Twainable.EffectPlugin

Vollständige Fehlermeldung: System.BadImageFormatException: Es wurde versucht, eine Datei mit einem falschen Format zu laden. (Ausnahme von HRESULT: 0x8007000B)

bei Dosadi.EZTwain.EZTwain.IsAvailable()

bei Twainable.EffectPluginConfigDialog.CheckAvailableTwain()

bei Twainable.EffectPlugin.CreateConfigDialog()

bei PaintDotNet.Menus.EffectMenuBase.RunEffectImpl(Type effectType) in D:\src\pdn\paintdotnet\src\PaintDotNet\Menus\EffectMenuBase.cs:Zeile 708.

Translation:

Complete Errormessage: System.BadImageFormatException: Tried to load a File with a wrong Format (Exception from HRESULT: 0x8007000B)

Although works fine on my XP x86 Laptop with same TWAIN 8) (Twain via Network for Lexmark X543)

greetz,
[color=#000080][b]Nordmann[/b][/color]

Link to comment
Share on other sites

I am trying to use Paint.NET 3.5 Build 3.51.3610.35022 instead of MS Photodraw. I have installed the Twainable plug as directed to enable me to use my EPSON STYLUS PHOTO RX630. When I scan to the clipboard the EpsonScan page pops up but in Configuration on the Clor tab with ICM dotted I cannot find jpegs in the list (this what I have been using when I use EpsonScan externally to Scan old photos or film). I have tried all the options on the Target drop down. However in all cases when I click on the clipboard icon I am getting an error message "Image in the clipboard cannot be recognised -Try recopying etc".

Link to comment
Share on other sites

  • 3 weeks later...

I also get the error when running windows 7 x64

File: D:\Program Files\Paint.NET\Effects\Twainable.dll

Effect Name: Twainable.EffectPlugin

Full error message: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

at Dosadi.EZTwain.EZTwain.IsAvailable()

at Twainable.EffectPluginConfigDialog.CheckAvailableTwain()

at Twainable.EffectPlugin.CreateConfigDialog()

at PaintDotNet.Menus.EffectMenuBase.RunEffectImpl(Type effectType) in D:\src\pdn\paintdotnet\src\PaintDotNet\Menus\EffectMenuBase.cs:line 708

Link to comment
Share on other sites

  • 2 weeks later...

Hello again everybody, sorry for the absence.

This plugin is merely a wrapper around the EZTwain Classic-dll (not written by me, but Dosadi). According to their site, their DLL only supports 32-bit Windows.

So sorry, only 32-bit.

EDIT: this also explains the error message "System.BadImageFormatException: Tried to load a File with a wrong Format (Exception from HRESULT: 0x8007000B)" - this is due to loading the 32-bit DLL in a 64-bit environment.

Link to comment
Share on other sites

  • 5 months later...

Hello to everybody,

I am a complete newcomer to this forum (actually to all techical forums) and tripped over this thread, since I have the same problem: my paint.net does not recognize/show my scanner canonScan Lide 20 when trying to acquire data from a scanner.

May you please be so kind and explain to me, where and how I can get the plugin you are talking about in this thread? What else is necessary to get my scanner running (aktually it works but does not cooperate with paint.net :()?

Thank you very much, sorry about these very basic questions

little onion (zwiebelchen in German)

Link to comment
Share on other sites

The download link for this plugin is at the very bottom of the first post in this thread.

Click where it says, Twainable.zip

-----------------------------------------

Inside the zip is a readme.txt that explains what to do.

Edited by Sarkut
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 1 month later...
  • 2 months later...

First off: Thank You! Thank You! Thank You!

I recently needed to dust off my old Canon LiDE 50 scanner and run a document through it. After doing the driver song and dance on Windows 7, I had the scanner working but only through the TWAIN interface... any of this sound familiar? So yes, thank you very much!

I did want to provide some feedback as well:

1) Repeating the "effect" doesn't seem to do anything other than pull the data in from the clipboard again.

2) I would really like to have an option to "scan to new image" or "scan to new layer" to skip the pasting step. This could also be used to keep mounds of data off the clipboard.

3) While I don't personally care, I kind of like the older option of having TWAIN appear under the Acquire menu better than an effect. Even though this is an "effect". Just wanted to throw my hat in the ring on this one...

Any chance you would consider opening the source and posting it on BitBucket, GitHub or CodePlex?

Link to comment
Share on other sites

  • 2 weeks later...

goyuix: nice to hear it's working for you!

Repeating the "effect" doesn't seem to do anything other than pull the data in from the clipboard again.

Probably true. I've never used the plugin in that way and therefore never actually thought of it. I'll look into it!

I would really like to have an option to "scan to new image" or "scan to new layer" to skip the pasting step. This could also be used to keep mounds of data off the clipboard.

Good suggestions - maybe for the next release! The Paint.NET API isn't something I quite master (yet?), so I'm unsure if effects are able/allowed to tamper with creating new images, or new layers. But it would be a good feature, nonetheless.

While I don't personally care, I kind of like the older option of having TWAIN appear under the Acquire menu better than an effect. Even though this is an "effect". Just wanted to throw my hat in the ring on this one...

As you probably already figured out, this isn't something I as an effect developer can change.

Any chance you would consider opening the source and posting it on BitBucket, GitHub or CodePlex?

Absolutely, for the next release. I've been working on a fresh code base that doesn't use the Dosadi EZTwain-DLL, and when it's mature enough I'll probably upload it somewhere (Google Code?).

Link to comment
Share on other sites

  • 2 months later...

Dear entusiast i have used your file on mustek scanner a3 usb but after acquiring the image, it appears entirely white... how is it possible? Thanks for every help you may give to me. and compliment for your work.

Morris.

Edited by azrael5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...