Page 1 of 1

imageArea empty

Posted: Fri Jan 25, 2013 2:49 am
by Nakia
Hi,

what is thebest way for mew to check if an imageArea has an actual image loaded to it?
Note - I can't check the imageData against a constant image as the image within the imageArea can consistently change..

Re: imageArea empty

Posted: Fri Jan 25, 2013 2:58 am
by Simon
I think you are going to have to be more specific...
if the imagData is empty then there is no image loaded into it?

Simon

Re: imageArea empty

Posted: Fri Jan 25, 2013 2:59 am
by sturgis
It depends. If you are using referenced images you can check to see if the filename is empty

if (the filename of img "whateverimage" is empty) then

If the image is actually imported into the stack you can check the image itself

if (image "whateverimage" is empty) then

Re: imageArea empty

Posted: Fri Jan 25, 2013 3:06 am
by Nakia
Okay,

I have 3 imageAreas (dragged directly from LC editor onto my Stack)
I am filling the content of each imageArea from the iphonePickPhoto function but I need to check which is the next empty imageArea so I know where to place the image (user can attach up to 3 photos)

I have tried the imageData = empty but its not giving me any joy (event though the image area is visually empty and I havent placed any imageData into it yet??)

EDIT -- I am using = empty (not is empty) , let me try this and I will report back..

Re: imageArea empty

Posted: Fri Jan 25, 2013 4:18 am
by Nakia
Seems to work fine!!!

What is the best way to resize the imageData (?) when I place into the imageArea..
My screen preview is at 500,500 and it looks great for a preview but then I need to place it in an imageArea (on a printingCard) that is 250,250 (constraint of the size of my printingCard)

Re: imageArea empty

Posted: Fri Jan 25, 2013 4:36 am
by Simon
In the image area property inspector > size & position > lock size and position.

Simon

Re: imageArea empty

Posted: Fri Jan 25, 2013 5:17 am
by Nakia
okay, after I do this simply placing the imageData of a 500,500 imgArea into this are (fixed at 250,250) will
take care of re sizing the image?

Re: imageArea empty

Posted: Fri Jan 25, 2013 5:26 am
by Simon
Well... What does it look like?

Simon

Re: imageArea empty

Posted: Fri Jan 25, 2013 5:34 am
by Nakia
Well, not good.. actually terrible!

The imageArea is blurry, I don't think its handling resizing down so far.....
It's painful becuase I am developing on standard resolution iPhone Card (tmControls) so I cant make the imageArea on the print card any bigger but I want to keep the preview in the App at 500,500 so its a nice size for the user to see...

Re: imageArea empty

Posted: Fri Jan 25, 2013 6:04 am
by Simon
There is a quality setting in the properties...
Is the image 1:1 aspect ratio? Most are 4:3 and these days 16:9.

I have an image here at 3264 X 2448 px and it still looks good at 250 X 250...

After this is sorted out remember to export the smaller image to save space.

Simon
EDIT: Not sure it might be an imageData thing... just set the filename of the large image to the smaller image.

Re: imageArea empty

Posted: Fri Jan 25, 2013 6:58 am
by Nakia
Sorry Simon.

Can you explain your EDIT..
I took it as it might be to do with imageData and to try setting the image file name
of the smaller image to that of ther larger ?

Re: imageArea empty

Posted: Fri Jan 25, 2013 7:16 am
by Simon
Hi,
Yes, sorry if I was unclear.
Lets forget about the imageData for a bit...

For a 500 x 500 image that is in the default folder
set the filename of image "bigImage" to "myImage.jpg"

Not sure that is the way you do it but it is a way to do it.

Then do the same with with the 250 x 250 image area
set the filename of image "smallImage" to "myImage.jpg"

Note that I am writing filename not file name.

Does that work for you?

Simon

Re: imageArea empty

Posted: Fri Jan 25, 2013 8:11 pm
by jacque
The imagedata is not the same as the text of the image. ImageData is the visual pixels on screen. Resizing that is like resizing a bitmap, it doesn't work. The "text" of an image, or just refering to it as "image", gives the binary data which is the actual content of the file on disk. You can resize that all over the place with good results.

Do not use imageData unless you want to reduce the size of your stack on disk, or you are sure you will never need more than what is currently visible. For example, you can set the filename of a locked image object, and the binary image it contains will automatically resize to fit. There will be a large amount of binary data in the object and you can continue to resize it forever without loss of quality. But if you will never need more than the thumbnail, it's silly to retain megabytes of data in your stack. All you want is the visual pixels you see on screen. In that case, you can set the imagedata of the image to the imagedata of the image (i.e., you are setting the content of the image to the pixel representation. Setting imagedata replaces the binary content.) Now your image has content that is only a few kilobytes. But it won't resize well any more because the original binary data has been replaced with the screen representation.

Code: Select all

put url ("file:myimage.png") into image 1 -- all binary is in the object and image is resizable
set the imagedata of image 1 to the imagedata of img 1 -- binary now replaced with screen bitmap
set the filename of img 1 to "myImage.png" -- all binary data is in the object but not stored in the stack, it is referenced from disk