Convert wmf to 1bpp monochrome bitmap

General discussions about GdPicture.NET.
Post Reply
Ken71
Posts: 3
Joined: Wed Mar 15, 2017 9:35 pm

Convert wmf to 1bpp monochrome bitmap

Post by Ken71 » Wed Mar 15, 2017 9:44 pm

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
Attachments
FaceFrame.png

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: Convert wmf to 1bpp monochrome bitmap

Post by Cedric » Fri Mar 17, 2017 12:01 pm

Hello,

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

Ken71
Posts: 3
Joined: Wed Mar 15, 2017 9:35 pm

Re: Convert wmf to 1bpp monochrome bitmap

Post by Ken71 » Fri Mar 17, 2017 5:13 pm

I placed it in a zip file and attached.
Attachments
FaceFrame.zip
(30.98 KiB) Downloaded 332 times

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: Convert wmf to 1bpp monochrome bitmap

Post by Cedric » Fri Mar 17, 2017 5:30 pm

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?

Ken71
Posts: 3
Joined: Wed Mar 15, 2017 9:35 pm

Re: Convert wmf to 1bpp monochrome bitmap

Post by Ken71 » Fri Mar 17, 2017 6:18 pm

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?

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: Convert wmf to 1bpp monochrome bitmap

Post by Cedric » Fri Mar 17, 2017 6:32 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest