CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [SOLVED] Image properties in label fields

Print topic Send  topic

Author Message
alfonso

Posts: 121
Posted: 01/23/2009, 12:25 AM

I want to put in 3 labels this information about an image before show it:

1. Size of a photo
2. Width
3. Height

Thanks
View profile  Send private message
damian

Posts: 838
Posted: 01/23/2009, 1:18 AM

what is the question?

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
alfonso

Posts: 121
Posted: 01/23/2009, 1:42 AM

I want to create a grid. This grid show an image. It is easy. I also want that behind, appears a text like this:

nameofdeimage (xxxx Kb)
Width: XXXXX
Height: XXXX

Then I need that php or javascript give me that values: size, witdh and height

Thanks
View profile  Send private message
mentecky

Posts: 321
Posted: 01/23/2009, 3:05 AM

Quote alfonso:
I want to create a grid. This grid show an image. It is easy. I also want that behind, appears a text like this:

nameofdeimage (xxxx Kb)
Width: XXXXX
Height: XXXX

Then I need that php or javascript give me that values: size, witdh and height

Thanks

$filename = "/path_to_file/";  
  
// Get original sizes   
list($width, $height) = getimagesize($filename);   
  
$size = filesize($filename);  
  
$grid->size_label->SetValue($size);  
$grid->height_label->SetValue($height);  
$grid->width_label->SetValue($width);

Something like that should work,

Rick
_________________
http://www.ccselite.com
View profile  Send private message
alfonso

Posts: 121
Posted: 01/24/2009, 1:14 AM

I try it and I get ok if I put a single name in filename like this:

$filename = "image.jpg";

but I get nothing with this line:

$filename = $imagenes_prensa->fichero->GetValue();

where imagenes_prensa is the name of the grid and fichero is the name of the field that have the name of the image.

Can you help me again? Thanks
View profile  Send private message
damian

Posts: 838
Posted: 01/24/2009, 1:35 AM

try
$filename = $Component->GetValue();

however i think it is more likely that your custom code is in the wrong place and is either executing too soon to get the value from the grid or too late to assign the values to your labels....

i think you might need to call it from the sql before you build the grid....



_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
alfonso

Posts: 121
Posted: 01/24/2009, 1:52 AM

I have made changes and now it is ok. I had code in Before Show (into grid). Now I have changes to Before show (into fichero field) and it is ok. Just one question: with this code shows image information of the same path
$filename = $Component->GetValue();

but I want to search into fotos/tn folder. I try this:

$filename = "fotos/tn/".$Component->GetValue();

but I get error.

Can you help again?
View profile  Send private message
alfonso

Posts: 121
Posted: 01/24/2009, 1:59 AM

Solved. It was OK.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.