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
|
 |
 |
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.... :)
|
 |
 |
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
|
 |
 |
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 |
 |
 |
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
|
 |
 |
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.... :)
|
 |
 |
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?
|
 |
 |
alfonso
Posts: 121
|
| Posted: 01/24/2009, 1:59 AM |
|
Solved. It was OK.
|
 |
 |