Coder Social home page Coder Social logo

lpng's Introduction

+----------------------------------------------------------+
|                                                          |
|        Ultra-light PNG loader library for Windows        |
|                                                          |
|                  http://swapped.cc/lpng                  |
|                                                          |
+----------------------------------------------------------+


  lpng implements loading of truecolor PNG images (with or 
  without an alpha channel) into 32-bit (RGB+A) Windows 
  bitmaps that can be used with AlphaBlend function.

  The .exe of a sample application is only 16KB in size,
  with 3KB taken by the actual PNG stored as resources.

+----------------------------------------------------------+

  License

  The PNG loading code (lpng.c) is written by me, Alex 
  Pankratov, and it is distributed under BSD license. The 
  deflate decoder (puff.c) is written by Mark Adler and 
  distributed under zlib license.

+----------------------------------------------------------+

  The API consists of just one function:

    HBITMAP LoadPng(const wchar_t * resName,
                    const wchar_t * resType,
                    HMODULE         resInst,
                    BOOL   premultiplyAlpha);

  It can be used to load a PNG from a disk file or from 
  a resource. Sample application demonstrating the use of 
  the API can be found in ./sample directory. The project 
  file is for Visual Studio 2005.

  The "premultiply" parameter controls whether the pixels'
  RGB values are 'pre-multiplied' at respective alpha value 
  if the alpha channel is present. This is a pre-processing
  step requied by the AlphaBlend function, so the parameter
  needs to be TRUE if the bitmap is going to be painted on
  a target DC using this function. Otherwise, e.g. if the
  bitmap is going to be used for an ImageList, it needs to
  be FALSE.

+----------------------------------------------------------+

lpng's People

Contributors

apankrat avatar jidzhang avatar

Watchers

 avatar  avatar

Forkers

15831944

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.