Results 1 to 10 of 34

Thread: BeRoPNG - A very tiny but complete PNG loader

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by BeRo View Post
    I do want to share my useful BeRoPNG unit here. It's very tiny but complete PNG loader with a own tiny inflate routine, so it has no external unit dependencies. It supports even extended features such as Apple's proprietary extension CgBI and so on.

    And here is the link: http://rootserver.rosseaux.net/stuff/BeRoPNG.pas (36 kB src)

    It's licensed under the 2-clause simplified BSD license.

    So have a lot fun with it
    Thanks for sharing BeRo!

    Is it ok if I use this in a closed-source DLL for an engine I am writing?

    if so, I was wondering, how does one use this?

    Code:
    function LoadPNG(DataPointer:pointer;DataSize:longword;var ImageData:pointer;var ImageWidth,ImageHeight:integer):boolean;
    is DataPointer just the start of a PNG file, and DataSize the same as the PNG file size?

    cheers,
    Paul

  2. #2
    Woo Hoo! I have now gotten PNG loading working in my engine...thanks BeRo, you rock!!

    I have attached a zip file containing my png loader, my bmp loader, my unfinished tga loader (needs converting to TFileStream still), and my image buffer unit that my loaders and texturing uses in my engine...

    image loaders.zip

    Enjoy
    cheers,
    Paul

  3. #3
    Nice. Thanks for sharing Paul.

  4. #4
    You're welcome I take, and I give LOL

    cheers,
    Paul

  5. #5
    Hey all, just so you know, I tried compiling my engine in Delphi 2010 instead of Lazarus, and the BeRo png file doesn't compile due to ansichar and char incompatibilities, and other similar stuff...

    So I fixed the compiling errors, but now it fails to load my test png file now due to some unknown issue

    Summary, it works using Lazarus, but not D2010 at the moment...no crash, just no image.

    cheers,
    Paul

  6. #6
    Ok, I have fixed it now and it runs under D2010! yay
    I also replaced all #0 with AnsiChar(#0)...

    BeRoPNG.zip

    cheers,
    Paul

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •