Solved

how to display png image in form

Posted on 2014-03-17
16
1,019 Views
Last Modified: 2014-04-09
hey guys, i have a test database where i'm trying to display a png image in my form. i'm not sure why but i only see the icon instead of the picture itself. i went to search on supported formats and png is indeed a supported format.

here's my empty database with just the table, form and image. could yall help me out? thanks! = )
Pictures.mdb
0
Comment
Question by:developingprogrammer
  • 8
  • 8
16 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39933791
It looks like this on my machine.snapshot
0
 

Author Comment

by:developingprogrammer
ID: 39933811
Oops sorry I attached the wrong photo!! Reattaching in 15 min when I get back to my computer!!
0
 

Author Comment

by:developingprogrammer
ID: 39935913
hey guys, here's the correct database where i can't get the png file to show. could yall help me take a look? thanks!! = )
Pictures.mdb
0
 
LVL 27

Assisted Solution

by:MacroShadow
MacroShadow earned 500 total points
ID: 39939520
When a user inserts a file using OLE Embedding (eg a png picture - which is what you are doing), Access attempts to invoke the application that is registered for that file-type/extension, and have it store the 'Object' using OLE mechanisms.  Only a few graphics applications support this functionality, and if the registered application does not, a default 'Package' is created (which cannot be displayed directly on a form/report).

In order to display the picture, Access attempts to invoke the application that was used to initially store the object.  If this application is not correctly installed & registered on the user's system, the image will display as an icon.

for more info read this article http://www.ammara.com/articles/accesspictureole.html#S3
0
 

Author Comment

by:developingprogrammer
ID: 39949511
hrmm i see. thanks for your sharing MacroShadow.

what do you then think is the best way to display this image? i'm thinking put it as the background of a form. is there a better way you can think of? thanks once again in advance!
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39949583
It's not a question of how you display the picture but rather how the picture is stored. In the aforementioned article you will see there are several ways to store pictures.
0
 

Author Comment

by:developingprogrammer
ID: 39957987
i see, apologies MacroShadow i must have missed that out! let me go through it again. thanks!! = )
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39958116
No problem.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:developingprogrammer
ID: 39984894
hi MacroShadow, my apologies for the delay in response!

i read through the article twice and was trying to understand how to fix this situation.

like what you said - "In order to display the picture, Access attempts to invoke the application that was used to initially store the object.  If this application is not correctly installed & registered on the user's system, the image will display as an icon."

what i did was:

1) press print screen
2) open paint
3) press ctrl + v
4) save the image as a png on my desktop
5) double click the image (this opens using Windows Photo Viewer)
6) save the image in my Access database table

what i thought would happen was - since the png file is registered with Windows Photo Viewer, Access would invoke Windows Photo Viewer to display the picture.

however Access is not and it shows as an icon.

so MacroShadow, how can i tell Access to use Paint or Windows Photo Viewer to display the picture?

thanks for your help once again and your very long patience with me!!
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39985167
What happens if you try it with a bmp instead of png?
0
 

Author Comment

by:developingprogrammer
ID: 39985340
whao MacroShadow, you're a genius!! it works!!

i guess now for the more in-depth part - why does it work? is it because it's raster not vector so anything can open it?

thanks for your insight and solution MacroShadow! most interested to find out and learn the why behind it = )
0
 
LVL 27

Assisted Solution

by:MacroShadow
MacroShadow earned 500 total points
ID: 39985348
0
 

Author Comment

by:developingprogrammer
ID: 39985410
hrmm MacroShadow, i went through the article and as per the previous post, i thought (like what you shared) because Paint was the programme used to initially store the object that Paint would be invoked to open the object too. hrmm. i still don't understand it but now i know that the solution is to store it as a bmp = ) thanks MacroShadow!!!
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39985592
No problem.
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39985593
Only a few graphics applications support this functionality
I guess Paint isn't one of them.
0
 

Author Comment

by:developingprogrammer
ID: 39988078
ok thanks once again MacroShadow! = )
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now