How to save bmp (black & white) image file?

Javier Jair Elizarraraz S

Member
Licensed User
How ?

Hello Erel, thank for take my question.

In library i can see the method for save bmp, but i dont know how save it only in black & white file (1 bit, not 24 bits).

---- Help in library (imageEdit) :-------------------
SaveImageBMP(Image, FileName): Saves the Image in BMP format to a file with filename Filename.
--------------------------------------------------------

Thanks a lot for any idea.
 

Javier Jair Elizarraraz S

Member
Licensed User
Note

I write a not right method (other library).

-----------------------------------------------------
In help library (imageEdit) say:
-----------------------------------------------------------
SaveImage(PathName As String, Channel As String, Format As String) :

The file formats are"J" for jpg : "B" for bmp : "G" for gif : "P" for png. Anything else is saved as jpg.

----------------------------------------------------------

Sorry.
 

agraham

Expert
Licensed User
Longtime User
The help actually says
SaveImage(PathName As String, Channel As String, Format As String) : Saves a file to to the PathName specified in the Format specified. This converts the internal 15 bit representation of the image to a bitmap using the gamma specified by SetOpGamma or by 2.2 as the default and saves it as a file. This operation updates the bitmap returned by ControlRef but leaves the internal15 bit representation unchanged. The colour channels saved may be specified as "R", "G" or "B". "L" saves the luminance (grayscale) and "C" or anything else saves the full colour image. Note that in all cases a 24 bit 3 channel colour image is saved even if a single colour is specified. Note that a file extension is not added and must be specified as part of the PathName. The file formats are"J" for jpg : "B" for bmp : "G" for gif : "P" for png. Anything else is saved as jpg.
So

Saveimage("c:\temp\test.bmp", "L", "B")

will save an image as a grayscale image but, as the help says, it is still a 24 bit RGB image in which each colour channel contains the luminance values for each pixel. The library does not provide any means saving an image with a different colour depth, like 256 grayscale or 256 colour palette, as the Compact Framework does not provide this functionality. Also note that devices earlier that WM5.0 can only save in bmp format.
 

Javier Jair Elizarraraz S

Member
Licensed User
I working with desktop now, but device is target too

Thanks Agraham

I want use webcam like a tool for specific OCR input, i found some morphologics routings that use b/w (1 bit) bmp file, i can move routines (vb) to basic4ppc and work all is same place, but i wish test all before of working with details.

May be i can call other tool (command format convert tool) using shell and take files names like parameters. I need found this auxiliary tool (program) to make the convertion (input; file image in 24 bit format , output; file in 1 bit format).

Sorry for my english, this is not my born language.

Regards.
 
Top