Page 1 of 1

imageobject change width and orientation

Posted: Sat Nov 09, 2013 8:21 am
by jawall
good morning,

I can sucessfully
1.
set the width of image myImage to myWidth
2.
set the angle of image myImage to myDegrees
But not both at the same time. When I do step 2 the width is (visually) the same as it was in the original, not what I have set it to in step 1 and I cannot find any way to change that.

Do you encounter the same behavior? Do you knw a way to work around?

Thank you
Jürgen

Re: imageobject change width and orientation

Posted: Sat Nov 09, 2013 8:46 am
by Simon
Hi Jürgen,
Yes, I'm seeing the same thing here.
A work around uses the very cool

Code: Select all

set the imagedata of image tImageName to the imagedata of image tImageName
This does it with a clone of an original hidden image (just in case you need to change the size again)

Code: Select all

on mouseUp
   clone img 1
   set vis of last img to true
   set the width of last img to 50
   set the imagedata of last img to the imagedata of last img  --NEAT-O!
   set the angle of last img to 90
end mouseUp
Simon
Edit: I didn't spend much time trying the figure out better ways. There are probably many of them.

Re: imageobject change width and orientation

Posted: Thu Nov 14, 2013 7:27 am
by jawall
Hey Simon,

thanks for the suggestion.
I tried your work around to no avail (but a crash of livecode). Where exactly would you put it in a handler? Like this?

Code: Select all

on mouseUp
   put the formattedheight of image 1 into h
   put the formattedwidth of image 1 into w
   set the height of image 1 to h/2
   set the width of image 1 to w/2
   set the imagedata of image 1 to the imagedata of image 1 -- < here?
   rotate image 1 -90
end mouseUp
Cheers
Jürgen

Re: imageobject change width and orientation

Posted: Thu Nov 14, 2013 8:32 am
by Simon
Hi Jürgen,
That works here.
What is your question?

Simon

Re: imageobject change width and orientation

Posted: Thu Nov 14, 2013 12:47 pm
by Klaus
Hi Jürgen,

did you set the "lockloc" (Lock size and position) of that image to TRUE?
Sound like that is the culprit.


Best

Klaus

Re: imageobject change width and orientation

Posted: Thu Nov 14, 2013 7:51 pm
by jmburnod
Hi Jurgen,

What are the result of

Code: Select all

 set the height of image 1 to h/2
set the width of image 1 to w/2
Maeby you can try

Code: Select all

 set the height of image 1 to round(h/2)
 set the width of image 1 to round(w/2)
Best regards
Jean-Marc