Page 1 of 1

Convert wmf to 1bpp monochrome bitmap

Posted: Wed Mar 15, 2017 9:44 pm
by Ken71
Using this code, I'm trying to convert the attached wmf to a 1bpp monochrome bitmap. In the wmf you'll see blue and red color. These colors do not show up in the bmp. What is the proper way to convert the wmf? I know the attached file is a png since I couldn't upload the wmf.

Code: Select all

Using oGdPictureImaging As New GdPicture11.GdPictureImaging
            Dim Image As Integer = oGdPictureImaging.CreateGdPictureImageFromFile(WMFFilename)
            'oGdPictureImaging.FxBlackNWhiteT(Image, 128)
            oGdPictureImaging.FxBlackNWhite(Image, GdPicture11.BitonalReduction.Stucki)
            oGdPictureImaging.ConvertTo1BppAT(Image)
            oGdPictureImaging.SaveAsBMP(Image, BMPFilename)
            oGdPictureImaging.ReleaseGdPictureImage(Image)
        End Using

Re: Convert wmf to 1bpp monochrome bitmap

Posted: Fri Mar 17, 2017 12:01 pm
by Cedric
Hello,

Can you please attach the original WMF file to this thread instead of the PNG version?

Re: Convert wmf to 1bpp monochrome bitmap

Posted: Fri Mar 17, 2017 5:13 pm
by Ken71
I placed it in a zip file and attached.

Re: Convert wmf to 1bpp monochrome bitmap

Posted: Fri Mar 17, 2017 5:30 pm
by Cedric
Thank you but this is not a WMF file, it is a 32-bit ARGB TIFF file with LZW compression that has been renamed.
I have no issue whatsoever to convert it to black and white with the latest release, what version of the toolkit are you using?

Re: Convert wmf to 1bpp monochrome bitmap

Posted: Fri Mar 17, 2017 6:18 pm
by Ken71
I had no idea it was a renamed file. Interesting. I am using version 11.2.0.10. Is the code block I provided above the correct approach to convert the file?

Re: Convert wmf to 1bpp monochrome bitmap

Posted: Fri Mar 17, 2017 6:32 pm
by Cedric
Yes, this is correct. You might want to update your SDK to the latest release available for this branch (11.2.39).
Here is a link to download it: https://orpalis.wimi.pro/download.php?c ... b10097b2f6