Image Configuration properties?
I've been messing about with OCR to try and at least do something with a system we use which simply presents the user with a large Canvas. The Canvas is actual lots of buttons (all of which are fully configurable for size, colour and position). The system in question uses an XML file as a "map" to find it's way around the Canvas.
What I want to do is fairly basic. Put simply, I want to be able to check some of the buttons (so a "piece" of the Canvas) to see if it has been set up correctly.
With OCR, I've just about go this working. But I want to try saving images with different settings to see if I can make the OCR more reliable/consistent.
To that end, I want to see if saving things in monochrome or something helps.
You can do this. You can specify the confirmation used when images are saved. The details are here:
https://support.smartbear.com/viewarticle/82260/
But there is no example on that page. There is an example here:
https://support.smartbear.com/viewarticle/83003/
.... but it isn't a very good one. It only specifies the file type in the configuration.
I want to try saving as a GIF. And I want to force it into Black & White. Which is listed as possible. But I can't figure out the syntax/format for the config option?
I've tried (attached to creating a CreatePictureConfiguration object):
("GIF") .... which saves as a GIF. Fine.
But ....
("GIF", "Windows system (20 colors)") .... throws an error.
("GIF", ColorReduction = "Windows system (20 colors)") .... throws an error.
("GIF", "", "Windows system (20 colors)") .... throws an error.
And then I got bored of trying random combinations and posted here.
Anyone know how it's meant to be formatted?
(Note to SmartBear - improving the given example so it does more than simply specify the format would be helpful.)
Hi Colin,
Here's how to specify the color reduction for GIF:
// JScript function Test() { var img = Utils.Picture; img.LoadFromFile("C:\\MyImage.bmp"); var gifConfig = img.CreatePictureConfiguration("GIF"); gifConfig.ColorReduction = "Windows system (20 colors)"; img.SaveToFile("C:\\MyImage.gif", gifConfig); }
We'll look at getting some more examples in the docs. Thanks for the feedback!