Recent

Author Topic: Load PNG, scale, draw to canvas with transparency  (Read 2892 times)

Thomas Munk

  • New member
  • *
  • Posts: 7
Load PNG, scale, draw to canvas with transparency
« on: October 21, 2013, 09:15:36 pm »
Is there a build-in way to do the following:
(or do I need an external library?)




(1)  Load a 32-bit PNG-image (with alpha transparency) from disk


(2) Scale this image (up or down) to another in-memory-image, using a quality interpolation, keeping alpha


(3) Draw this in-memory-image to the Form's Canvas, blending with the background (using alpha)




If I didn't need (2) then everything works fine with TPortableNetworkGraphic and Form.Canvas.Draw...

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Load PNG, scale, draw to canvas with transparency
« Reply #1 on: October 22, 2013, 05:43:38 am »
The "quality interpolation" part is not possible without external library, or manual pixel calculations. You can try BGRABitmap library, as it is commonly hinted on these forums.

 

TinyPortal © 2005-2018