Link to home
Start Free TrialLog in
Avatar of antares2001
antares2001

asked on

How display a PNG picture using VB5 Image object - need complete code - novice

I like display pictures in image vb5 control .
jpg anfd gif are supported without problem.
How display also PNG pictures?
Please, complete code because I'm novice in vb programming.
I include example to finish/modify.

THE FILE UPLOADER BLOCKED ME SOME EXTENSIONS.
To use it rename the files:
form1frm form1.frm
form1frx form1.frx
progetto1vbp progetto1.vbp
progetto1vbw progetto1.vbw


test-png.zip
Avatar of Dana Seaman
Dana Seaman
Flag of Brazil image

Vb Image and PictureBox contros do not support PNG.
Download this free control that supports PNG:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=68262&lngWId=1 
Avatar of antares2001
antares2001

ASKER

This is very nice but more complicated example. I'm looking for simple way , to exchange image control with png supportable control.
The reason AlphaImage Control is complicated is that it supports 32-bit alpha images(Png, Bmp, Ico), Gif and will work on OS Win98 or later even if you do not have GDI+ installed.

If all you want is Png support, this can be done easily with GDI+ which limits you to XP or later(unless you install GDI+ on Win98). You will need at minimum a PropertyPage, UserControl, and a GDI+ support module. Not really something you could put together in a few minutes. It would probably take several hours.
I have to do it on visual basic 5 to modify an old software that work fine on w98 2000 xp etc

aicAlphaImage includes a folder "Usercontrol Only". Run "AlphaImageControl.vbp" and it will create an OCX. Then go to Project/AlphaImageControl Properties/Component and set Binary compatibility = True and point to the OCX you just compiled. This ensures that you have a unique GUID for this control.

Add the OCX to your project via Project/Components and the control should appear in the ToolBox.

I try, but where can I download aicAlphaImage and AlphaImageControl.vbp ?
I have compiled ocx control and add to my own project.
I can view PNG images, but only in iteractive mode (open file -browse ...etc)
I need have a control property to view images from program running, and not in interactive mode, that is same as use internet explorer.
Sorry, this is not my soluction.
:(
ASKER CERTIFIED SOLUTION
Avatar of Dana Seaman
Dana Seaman
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Fine!
I'm incoming to pay points to danaseaman.
Only another dubt: the compiled AlphaImageControl.ocx is free or have to be purchased or paid or licensed or is trialware and expire....... ?

Thank you, now is all clear. Regards
AlphaImageControl.ocx is free.
Hi, thank you for all.
If you want, you can contact me directly by form http://www.realmeteo.com/contact_form.asp , so I have an extra gift for you (if you like it).
Luciano P.
Hi,
I speak about AlphaImageControl.ocx with a VB Guru....
Is strange that it include ZLIB.DLL ..... (more emplojed for build spyware and malware)!?
Is real?
What about?
Zlib is included so that you do not need to install GDI+ on Win9x systems. It contains compression and decompression functions. Zlib is not Spyware or Malware. See http://www.zlib.net/ 
Thank, I see for it.

In any case I have open a new question about, and if you want 125 extra points go on
https://www.experts-exchange.com/questions/23514048/How-use-MsPaint-exe-in-VB5-to-open-PNG-picture-and-save-it-in-BMP.html

bye
I have a remark.
DLL included in OCX is ZLIB1.DLL and not ZLIB.DLL

What is ZLIB1 ??