Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-13
18
Medium Priority
?
1,440 Views
Last Modified: 2011-10-19
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
0
Comment
Question by:antares2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 8
18 Comments
 
LVL 22

Expert Comment

by:danaseaman
ID: 21778050
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 
0
 
LVL 1

Author Comment

by:antares2001
ID: 21778159
This is very nice but more complicated example. I'm looking for simple way , to exchange image control with png supportable control.
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 21781743
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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:antares2001
ID: 21785552
I have to do it on visual basic 5 to modify an old software that work fine on w98 2000 xp etc

0
 
LVL 22

Expert Comment

by:danaseaman
ID: 21785607
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.

0
 
LVL 1

Author Comment

by:antares2001
ID: 21791108
I try, but where can I download aicAlphaImage and AlphaImageControl.vbp ?
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 21792816
0
 
LVL 1

Author Comment

by:antares2001
ID: 21803459
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.
:(
0
 
LVL 22

Accepted Solution

by:
danaseaman earned 2000 total points
ID: 21804057
At runtime you can load images from File, Resource, Array, Clipboard, Handle, or StdPicture:
Option Explicit
 
Private Sub Form_Load()
   aicAlphaImage1.LoadImage_FromFile (App.Path & "\firefox3.png")
   'aicAlphaImage1.LoadImage_FromResource VB.Global, "Custom", "LaVolpe"
End Sub

Open in new window

0
 
LVL 1

Author Comment

by:antares2001
ID: 21853557
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....... ?

0
 
LVL 1

Author Closing Comment

by:antares2001
ID: 31466878
Thank you, now is all clear. Regards
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 21861852
AlphaImageControl.ocx is free.
0
 
LVL 1

Author Comment

by:antares2001
ID: 21863017
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.
0
 
LVL 1

Author Comment

by:antares2001
ID: 21863620
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?
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 21864396
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/ 
0
 
LVL 1

Author Comment

by:antares2001
ID: 21864430
Thank, I see for it.

In any case I have open a new question about, and if you want 125 extra points go on
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_23514048.html

bye
0
 
LVL 1

Author Comment

by:antares2001
ID: 21864547
I have a remark.
DLL included in OCX is ZLIB1.DLL and not ZLIB.DLL

What is ZLIB1 ??
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 21864601
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question