Home › Forums › TWAIN Classic › Bug in newest Twacker 11/22/2011
- This topic has 1 reply, 2 voices, and was last updated 12 years, 3 months ago by peterp.
- AuthorPosts
Not sure where to report bugs about the sample applications.
In the file DCA_ACQ.C in the function “static void DoMemTransfer(HWND hWnd)” there is the calculation to populate the BITMAPINFOHEADER.biXPelsPerMeter. This calculation is incorrect for the case of TWUN_INCHES:
Incorrect Code (currently being distributed)
pdib->bmiHeader.biXPelsPerMeter = (LONG)((XRes*2.54)*100);
pdib->bmiHeader.biYPelsPerMeter = (LONG)((YRes*2.54)*100);Corrected Code:
pdib->bmiHeader.biXPelsPerMeter = (LONG)((XRes/2.54)*100);
pdib->bmiHeader.biYPelsPerMeter = (LONG)((YRes/2.54)*100);or you can change it to this:
pdib->bmiHeader.biXPelsPerMeter = (LONG)((XRes*39.3700787)*100);
pdib->bmiHeader.biYPelsPerMeter = (LONG)((YRes*39.3700787)*100);Line numbers are 1422 and 1423.
Thanks for reporting that. It will be fixed in the next update of the sample source code.
- AuthorPosts