Hi all,
I started with fixing a problem with my HP OfficeJet scanner and now I'm
having a look at several issues that I found checking the code of the
scanner dialog used in writer and draw. The functionality is there, but
it looks like old, unmantained code.
Bugs fixed so far:
1) The dialog offered two resolution selections for the OfficeJet: 75
and 1200 DPI, the minimum and maximum. The OfficeJet can scan at any DPI
value between 75 and 1200, but the edit box was not editable. I inserted
some additional DPI values in the listbox and made the edit box editable.
This should work for any scanner that can scan at any DPI value between
min and max.
2) Tested with a Canon Lide scanner, the listbox offered several DPI
values, but again only the min and max values were selectable, The code
wrongly set the min and max listbox range: the min DPI value as max and
viceversa. This happened because the Lide can scan at fixed DPI values,
but the driver returns the values in the opposite order to what the code
expected it to be. The resolution edit box is not editable.
I reworked the user interface. The changes so far.
3) Moved controls around to make the dialog more compact.
4) Added a listbox to choose the scan mode (Color, Grey and Lineart)
directly, without accessing the advanced options treebox. Several mouse
clicks saved. And
5) removed the Advanced options checkbox. The treebox is always in
advanced mode.
6) Increased the size of the preview rectangle.
The preview rectangle poses a problem. The X and Y sizes are constants
set in the .hrc file. I can turn them into variables, and set them at
runtime according to the width and height of the scan area (the
OfficeJet has 220x381 mm, the Lide 215x300 mm, for instance) and within
the bounds of the dialog box.
But the preview image is always vertically squashed because the screen
aspect ratio is not taken into account.
Aspect ratio is usually 1,25 (for 1280x1024) or 1,33 (for 1024z768), but
new LCD screens can have other ratios.
I couldn't find a way to determine this ratio. There are private
variables in the Window class that (my guess) should hold these values.
I think that some functions, such as PixelToLogic, etc should provide
help, but I couldn't find any documentation.
Can anybody provide help or a hint?
If anybody with a build system and a working scanner is keen to test the
beast, I will send another email witih the relevant files attached.
Thanks in advance.
Carlo Scarfoglio
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]