News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

libpng

Started by Biterider, October 10, 2022, 12:22:48 AM

Previous topic - Next topic

NoCforMe

I know GDI+ handles JP(E)G, GIF (and of course BMP), but does it know how to handle PNG? or WebP? (Pretty sure it doesn't do the latter.)
Then there's TIFF ...
Assembly language programming should be fun. That's why I do it.

jj2007

Test it...

GuiParas equ "Gdi+ rocks - drag an image file over the exe", w300, h500
guiTimerMs=500 ; a slow timer
include \masm32\MasmBasic\Res\MbGui.asm
Event Paint
  .if CL$() ; commandline supplied?
GuiImage eax, fit
  .else ; otherwise use an image from the web
GuiImage "http://www.jj2007.eu/pics/animated.tif", fit
  .endif
Event Timer
  GuiCls ; animated images need this ;-)
GuiEnd


Source & exe attached. See CL$(), Event, GuiImage

No idea why they insist to call it "multi-page tif", it works exactly like an animated gif. Unfortunately, it is very difficult to find an animated tif on the web. And of course, you are right about webp - that's too recent for Gdi+ :sad:

TimoVJL

#17
Wasn't TIFF a scanner / fax picture format with multiple pages.

nickname_
"TIFF: Thousands of Incompatible File Formats"
May the source be with you

NoCforMe

Yes it was, although it's certainly not limited to fax or low-res scanned images.

Tagged Image File Format. The "tagged" is what's nice about this implementation: the format includes many possible sections, each identified by a "tag" (a unique binary value). If a TIFF reader comes across a section it doesn't understand, it can simply skip over it, as each section contains a field which lets you find the next section. So it's very backwards-compatible.

TIFF was used a lot (still is used?) by places that do very high-resolution scanning, like for art books and the like. It's probably been replaced by other formats for the most part.
Assembly language programming should be fun. That's why I do it.

Biterider

Hi
I had a few days off and am surprised to see all of these posts today.  :thumbsup:

As we all know, to load PNG and other common formats from files, the commonly accepted solution is using GDI+ and in most cases that's perfectly fine.
The idea behind my post about using other libraries is to explore code alternatives, in this case the original code base of the creators of PNG. If you take a closer look, they provide a lot of functionality that you don't have in GDI+.

My motto is don't close your eyes to alternatives to the established and always stay curious, even if it's sometimes a bit difficult and tedious.
It always pays off.  :cool:

Biterider

avcaballero

I did it for several graphics formats, but not for png yet

http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=4&Lang=1&nivel=0&padre=0&accion=0