[sane-devel] Gray frame with sane_control_option

Henning Meier-Geinitz henning@meier-geinitz.de
Sat, 24 May 2003 13:09:23 +0200


Hi,

On Sat, May 24, 2003 at 12:00:12PM +0200, pierre wrote:
> I'm developping a front end with GTK 1.2

That's nice. You know that there are already a few of those (XSane,
xscanimage, xcam)?

> with sane_get_parameters I always recieve SANE_FRAME_RGB (=1) format
> otherwise i set the option mode = 0

Which backend do you use?

> I try with
> sane_control_option(h,i,SANE_ACTION_SET_VALUE,&integer,&n)
> where i = 1,integer = 0

Have you checked what kind of option "mode" is? I would be surprised
if it is an integer option. If it's a string option with a string list
constraint you must use a pointer to a string, not a pointer to an
integer. See the SANE standard for details.

> Is there any solution or the scanner will always scan in RGB and the
> frontend should convert RGB to Black and white ?

Depends on the backend and scanner but I guess most scanner can do
gray scans.

Bye,
  Henning