Author Topic: Load and save BMP images with image scaling.  (Read 508 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7638
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Load and save BMP images with image scaling.
« 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Biterider

  • Member
  • ****
  • Posts: 546
  • ObjAsm Developer
    • ObjAsm
Re: Load and save BMP images with image scaling.
« Reply #1 on: May 04, 2020, 11:27:31 PM »
Works fine here (Win 10 - 64bit - Home)


Biterider

Siekmanski

  • Member
  • *****
  • Posts: 2377
Re: Load and save BMP images with image scaling.
« Reply #2 on: May 04, 2020, 11:32:52 PM »
Works perfect on Win8.1
Creative coders use backward thinking techniques as a strategy.

daydreamer

  • Member
  • *****
  • Posts: 1391
  • building nextdoor
Re: Load and save BMP images with image scaling.
« Reply #3 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

Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

Vortex

  • Member
  • *****
  • Posts: 2383
Re: Load and save BMP images with image scaling.
« Reply #4 on: May 05, 2020, 04:39:00 AM »
Hi daydreamer,

No any constant for bitmaps :

Code: [Select]
EncoderValueCompressionRle For a TIFF image, specifies the RLE compression method.
https://docs.microsoft.com/en-us/windows/win32/api/gdiplusenums/ne-gdiplusenums-encodervalue

Siekmanski

  • Member
  • *****
  • Posts: 2377
Re: Load and save BMP images with image scaling.
« Reply #5 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
Creative coders use backward thinking techniques as a strategy.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7638
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Load and save BMP images with image scaling.
« Reply #6 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Siekmanski

  • Member
  • *****
  • Posts: 2377
Re: Load and save BMP images with image scaling.
« Reply #7 on: May 05, 2020, 07:53:41 PM »
 :biggrin: Now working on saving PNG icons and cursors.
Creative coders use backward thinking techniques as a strategy.