|
I use twain.h in vc++ application for scanner operation. twain.h file contains n number of capabilities (like CAP_DUPLEXENABLED,ICAP_XRESOLUTION,ICAP_AUTOMATICROTATE etc) which are supported by scanner. kindly help me how to use CAP_ENDORSER and TWEI_ENDORSEDTEXT capabilities to do endorsement in the scanner.
sujtha
modified on Wednesday, December 9, 2009 5:13 AM
|
|
|
|
|
I have this code that loads a DIB bitmap from a file and passes it to SetDIBitsToDevice.
This code works:
FILE* f = fopen(".\\bitmap1.bmp", "rb");
vector<BYTE> buffer;
buffer.resize(_filelength(f->_file));
fread(&buffer[0], buffer.size(), 1, f);
BITMAPINFO* bminfo = (BITMAPINFO*) &buffer[14];
BITMAPFILEHEADER* bmh = (BITMAPFILEHEADER*) &buffer[0];
LPVOID bits = &buffer[bmh->bfOffBits];
SetDIBitsToDevice(
pDC->GetSafeHdc(),
0,
0,
bminfo->bmiHeader.biWidth,
bminfo->bmiHeader.biHeight,
0,
0,
0,
bminfo->bmiHeader.biHeight,
bits,
bminfo,
DIB_RGB_COLORS
);
But this doesn't. The only differences are in the source origins and width/height/number of scanlines. I'm trying to pass a smaller rectangle that starts at (100,100) and has the same lower-right corner (hence smaller width/height).
FILE* f = fopen(".\\bitmap1.bmp", "rb");
vector<BYTE> buffer;
buffer.resize(_filelength(f->_file));
fread(&buffer[0], buffer.size(), 1, f);
BITMAPINFO* bminfo = (BITMAPINFO*) &buffer[14];
BITMAPFILEHEADER* bmh = (BITMAPFILEHEADER*) &buffer[0];
LPVOID bits = &buffer[bmh->bfOffBits];
SetDIBitsToDevice(
pDC->GetSafeHdc(),
0,
0,
bminfo->bmiHeader.biWidth-100,
bminfo->bmiHeader.biHeight-100,
100,
100,
0,
bminfo->bmiHeader.biHeight-100,
bits,
bminfo,
DIB_RGB_COLORS
);
What can be the problem with the second code?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
are you sure SetDIBitsToDevice lets you draw sub-sections of a DIB ?
|
|
|
|
|
I never have used SetDIBitsToDevice() myself. I would suggest you to use Stretchblt(), it's almost the same. I'm sure that one does the job...
My experience is that problems with these functions mostly are caused by:
- wrong coordinate system (try negative values)
- pending clipping areas
So if you try Stretchblt() and it doesn't work either you know its not in the coordinates..
And, as someone on CP a few days before suggested, there seems to be a 'DCviewer' somewhere on CP.
Good luck
Rozis
|
|
|
|
|
Hi,
I am writing a small app to connect 2 computers. When i test the server side right from my computer, it 's ok. But because i am using a shared network with a router, my friends cannot connect to my computer by using my IP (because it is a local ip). Can anyone suggest a way to overcome this problem, please?
|
|
|
|
|
You may configure your router for NAT [^], [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
so, that 's means i have to configure something "manually". Is there any solution by using code? I just wonder how p2p apps can work when 2 comps connected directly to each other and one comp is under a shared network
|
|
|
|
|
bubuzzz wrote: I just wonder how p2p apps can work when 2 comps connected directly to each other and one comp is under a shared network
When one of the two peer-to-peer appliacations is inside a private network, you've to configure (manually) the router for NAT .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
bubuzzz wrote: so, that 's means i have to configure something "manually". Is there any solution by using code? I just wonder how p2p apps can work when 2 comps connected directly to each other and one comp is under a shared network OMG
As long as one of the two peers is not firewalled (incoming connections are not blocked), they can make a connection. If both are in a local network without port forwarding it gets much more trickier, but there are still possibilities (as Skype shows).
/M
|
|
|
|
|
Port forwarding is not possible (see router configuration)?
|
|
|
|
|
yup. That is what i am trying these day. Thanks all for replying me
|
|
|
|
|
How do i generate tables in WORD through code? i am creating an application where i have to create tables depending on the input given. for example, if there are 10 objects there should be 10 rows and each row should have an object.
i was trying some examples in CP. couldnt find any.. if somebody can help me it would be great
|
|
|
|
|
There are actually some goo examples about office automation here at CP [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi Members
I am try to show Message when copy file or folder from windows explorer.Is it possible?
|
|
|
|
|
What do you mean?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
You want to show the copy operation progress while it is being performed? Take a look at CopyFileEx[^] function, especially the third parameter.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
i am not going to copy file folder.If copy function of windows is stsrt then i want to show message.If i use CopyFile function then easily i can show message.
I want to show message when windows copy function is start then.
Plz help me
|
|
|
|
|
There is any more opinion.About this topic.
|
|
|
|
|
Hai,
I am having a C++ MFC Application. I have downloaded the original application from a website Metaqoutes.net.I have modified the program & run the pgm.It is wrkng correctly.that is when i build it & debug it,it is wrkng.But when i go to debug folder & running the Application.Exe it is showing the result of the original exe,i.e my changes r nt reflected in that.I am wrkng on VC++9 bt d original program is VC++6.Please help me
|
|
|
|
|
Check your project settings to see what is the output directory.
|
|
|
|
|
I have a project similar to installation program, which has an uninstall app - I hope the uninstall-app deletes all programs including itself - of course failed because it is in running.
I just wandering why normal installation programs, such as inno, can delete uninstallation program itself? what is deep story inside?
any comments?
|
|
|
|
|
|
it is interesting, I will do a test.
thanks
|
|
|
|
|
That's a C# article.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|