The MASM Forum

General => The Laboratory => Topic started by: hutch-- on May 04, 2020, 10:34:08 PM

Title: Load and save BMP images with image scaling.
Post by: hutch-- on May 04, 2020, 10:34:08 PM
Could I impose of some of our members to test this app on bitmaps. I have written a scaling algorithm based on StretchBlt with the HALFTONE setting and it is testing OK on my Win10 box. I have been testing on high res 1920 x 1080 bitmaps and from 100% down to very small the image quality seems to be OK. It will both upscale and downscale and the downscale images look clean and sharp but as expected, an upscaled image never improves on the original.
Title: Re: Load and save BMP images with image scaling.
Post by: Biterider on May 04, 2020, 11:27:31 PM
Works fine here (Win 10 - 64bit - Home)


Biterider
Title: Re: Load and save BMP images with image scaling.
Post by: Siekmanski on May 04, 2020, 11:32:52 PM
Works perfect on Win8.1
Title: Re: Load and save BMP images with image scaling.
Post by: daydreamer on May 05, 2020, 03:25:58 AM
works fine under win10 64bit
I just wonder if it already exist GDI+ function to load RLE compressed file,well its more kinda a save function with RLE that is missing in usual paint program

Title: Re: Load and save BMP images with image scaling.
Post by: Vortex on May 05, 2020, 04:39:00 AM
Hi daydreamer,

No any constant for bitmaps :

EncoderValueCompressionRle For a TIFF image, specifies the RLE compression method.

https://docs.microsoft.com/en-us/windows/win32/api/gdiplusenums/ne-gdiplusenums-encodervalue
Title: Re: Load and save BMP images with image scaling.
Post by: Siekmanski on May 05, 2020, 04:41:44 AM
GDIplus can load and save RLE and many more bit and color types.
In the sources you can find BMP RLE as well.

32bit
http://masm32.com/board/index.php?topic=8483.msg92918#msg92918

64bit
http://masm32.com/board/index.php?topic=8483.msg92942#msg92942
Title: Re: Load and save BMP images with image scaling.
Post by: hutch-- on May 05, 2020, 07:24:01 PM
This stuff done by Marinus has been super useful, I have so far used this work for both the BMP and JPG code in the 64 bit library and as I get a bit more time I will use more of it.
Title: Re: Load and save BMP images with image scaling.
Post by: Siekmanski on May 05, 2020, 07:53:41 PM
 :biggrin: Now working on saving PNG icons and cursors.