Hi,
Yes, there are 6 files.
I don't understand why you have to use a lot of tricks. Is there any other person that can try downloading the file and decompress it to check if there is any error on uncompress it?
Hi,
Yes, there are 6 files.
I don't understand why you have to use a lot of tricks. Is there any other person that can try downloading the file and decompress it to check if there is any error on uncompress it?
Òscar Llarch i Galán
the notice on the forum says that they have some problems into attachments before 1st sep 2010. may be that is the issue. the new file is good.
I don´t Know but the newest file had the same problem that the first one to open. I don´t Know why but... I tried with diferents programs to deskompress the file . The same message..."end of file corrupt"... "the file can´t bee opened"....
Finnally i got the file opened in an unusual way. I have the six files and must find time to study them.
Thanks
Jokinb
Hello all,
Have you got any simple example to use this class ?
I have try to acquire and save 1 A4 image :
Qt Code:
#include <iostream> #include "qtwain.h" using namespace std; int main(int agc, char **argv) { QTwain t; t.initTwain(); if(t.isValidDriver() && t.selectSource()) { t.setResolutionY(1654); t.setResolutionX(2339); t.setDepth(1); t.acquire(1); } return 0; }To copy to clipboard, switch view to plain text mode
But it doesn't work; why ?
For your help, by advance, thanks.
The 'example' in the code!
Just look in there.
Qt Code:
void QtTwainScan::scan() { if (!m_pTwain->initTwain()) qWarning("initTwain() call not successful!"); else if (!m_pTwain->selectSource()) qWarning("selectSource() call not successful!"); else if (!m_pTwain->acquire()) qWarning("acquire() call not successful!"); }To copy to clipboard, switch view to plain text mode
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Happy new year.
I have tried this (with QtCreator or the CLI) :
Qt Code:
#include <QApplication> #include "qtwain.h" int main(int argc, char **argv) { QTwain m_pTwain; if (!m_pTwain.initTwain()) qWarning("initTwain() call not successful!"); else if (!m_pTwain.selectSource()) qWarning("selectSource() call not successful!"); else if (!m_pTwain.acquire()) qWarning("acquire() call not successful!"); return app.exec(); }To copy to clipboard, switch view to plain text mode
But I still have a segmentation error,
Have you ever have this bug ?
By advance,
Thanks
Happy new year to you too!
I just had a 2 seconds look - to see if I could help you getting started.
I didn't look further.
But you should.
Maybe there are some initializations needed to be done, I don't know, stuff like that.
Follow the application in the debugger, and see exactly where it crashes, it will tell you a lot about what the problem is.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
It is probably because the QTwain class requires an event loop to be running, and until you call app.exec(), there is no event loop.
Your code is fundamentally different from the example in the previous post in the thread. You need to move your twain code into a method that gets called after the event loop has started.
Good point.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Thank you very much,
I create a Widget QTwain and used according to your examples, but I have not found a way to save the image acquired only by the interface.
The only way, according to my investigations, would be to uncomment the lines 92 to 95 of qtwain.cpp, and yet I know not how to get the values to pass as an argument to CopyImage.
For your help,
By advance,
Thanks
Hi,
As I said, I only modify code snippets to get to do what I needed. Improvements that you can get will be welcome.
I only tested on a Brother multifunction printer, so If anyone can test on othre devices and check if it works it will be great.
Òscar Llarch i Galán
Hello,
thank you for your answers
I have cleaned the code and set more generical QtTwain and I have added a methode to save the scanned image.
Enjoy
Hi
First thanks to kata for you help. Now the problem is that I can not see the image out.jpg. debido a esto:
QPixmap::fromWinHBITMAP(), failed to get bitmap info ()
I have windows 7, qt creator 2.01 based qt 4.7.0.
this is what I do
1)instal qt creator sdk
2) open qt creator, open project, I look for. pro and open it.
3) running
What am I doing wrong? or I'm missing.
-----------------------------------------------------
In the .pro :
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
LIBS += -lgdi32
# Input
HEADERS += qtwain.h stdafx.h twain.h twaincpp.h
SOURCES += main.cpp qtwain.cpp twaincpp.cpp
-------------------------------------------------------
Qt displays the following messages:
Application Output:
Starting C:\Users\Elegido\Desktop\QtScanner5-build-desktop\debug\QtScanner5.exe...
QPixmap::fromWinHBITMAP(), failed to get bitmap info ()
Compile output:
Running build steps for project QtScanner5...
Configuration unchanged, skipping qmake step.
Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/Users/Elegido/Desktop/QtScanner5-build-desktop'
C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/Elegido/Desktop/QtScanner5-build-desktop'
mingw32-make[1]: Nothing to be done for `first'.
mingw32-make[1]: Leaving directory `C:/Users/Elegido/Desktop/QtScanner5-build-desktop'
mingw32-make: Leaving directory `C:/Users/Elegido/Desktop/QtScanner5-build-desktop'
The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited normally.
PLease Help!! tThanks
Hi,
Someone is telling me that the file is not uncompressing right. Try this other one
Òscar Llarch i Galán
Bookmarks