How can I show png images ? I don't want to use third part library. Only Windows APIs.
Can I use IE4 in my application to do this?
How ?
Posted on 2002-05-16 15:24:43 by greenant
You don't want to use a third part lib ? Look at this thread and
see how much work it is doing it by yourself ;)

Thomas' PngLib
Posted on 2002-05-16 15:36:12 by JimmyClif
The windows API does not provide a way to display PNGs. I've seen some things about using PNGs with specific devices that support it (like printers) but that's probably not very useful.
The IPicture COM interface can be used to display GIF/JPG/several others, but no PNG.
Using internet explorer is possible, implementing this browser into your app is quite difficult (you need to write an activeX container for it). However I think it's way overkill to use IE just for displaying PNGs.
Although you said you didn't want to use a library, have a look at the PNGlib at my site anyway. It's quite small, fully written in asm and definitely faster than using IE.

Thomas
Posted on 2002-05-16 15:38:46 by Thomas
Thanks. I have to use it for a screenshot viewer for my Gremaf ( Greenant MAME Frontend).
Mame is Multiple Arcade Machine Emulator www.mame.net
Posted on 2002-05-17 15:37:42 by greenant
well you might have a problem then since you release under GPL and Thomas does not.
Posted on 2002-05-17 16:17:22 by Hiroshimator
As already reported in other posts there is a very nice trick useful if you only need to show small gif or png (not if you are planning to develop a paint program :grin: ). Use a listview. With the message LVM_SETBKIMAGE you can set the background image of a listview (remember also to call CoInitialize/CoUninitialize when you start/stop your app). It couldn't be more easy.

Edit:
I could be misunderstood. I highly apreciate Thomas' work. This technique to show a png or a gif is only a trick, applicable only if you need ultra-basic functionalities. If you need a better image support use a library like Thomas' one.
Posted on 2002-05-17 17:09:54 by LuHa
GDI+ supports PNG images but only XP systems or eariler windows versions with Internet Explorer 6 (I think) have GDI+

Also GDI+ doesn't use use API calls as such. Rather it uses COM or OOP (I dont understand the difference between either of these) to implment 99% of its functionality.
Posted on 2002-05-19 00:52:27 by huh

Also GDI+ doesn't use use API calls as such. Rather it uses COM or OOP (I dont understand the difference between either of these)
The difference is like to say "I want to travel around the universe", and then try to do it with a bicycle. :grin:
Posted on 2002-05-19 04:36:23 by Maverick
GDI+ supports PNG images but only XP systems or eariler windows versions with Internet Explorer 6 (I think) have GDI+


I'm running win2k, service pack2 with IE 6 but even then I didn't have gdiplus.dll. It's available as redistributable for win2k/NT4(?)/win98 though.

Also GDI+ doesn't use use API calls as such. Rather it uses COM or OOP (I dont understand the difference between either of these) to implment 99% of its functionality.


OOP is Object Oriented Programming, ie programming using objects. COM is an implementation standard (designed to be language-neutral) for objects. It describes how COM objects should be created, what their structure is and so on.

However gdiplus doesn't use COM, in fact the dll consists of just a bunch of normal API functions but the platform SDK contains the C++ (only) wrappers for these functions (some additional code as well). Your not supposed to use the functions directly (iirc they are not documented, only the C++ stuff), although I think it's possible.
It looks like a nice API, I think it's using directX for it's output so it probably uses hardware acceleration as well. Too bad it's C++ only and a bit 'too new'.

Thomas
Posted on 2002-05-19 05:19:12 by Thomas

The difference is like to say "I want to travel around the universe", and then try to do it with a bicycle. :grin:


you'll get there in the end, Capt. Kirk did :grin:
Posted on 2002-05-19 06:25:57 by Hiroshimator