problem with combination of set angle and rescale

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

problem with combination of set angle and rescale

Post by Tomka » Fri Jun 10, 2011 9:32 am

Hi there,

I got a strange problem with the combination of set an angle and changing heigth/width of an image. Its no problem to change the angle - works very fine. Its also no problem to change the imagesize (set heigth/width) - works also fine. I do this using 2 different scrollbars :)

BUT when the user first resized the picture (e.g. makes it smaler) and then rotates it - the image will be shown in its original size but the imagefield itself still got the resized proportions. So the imagecontent doesnt fit in the imagefield anymore -> means: proportions of the imagecontent > proportions of the imagefield.

Sry, cant explain it in a better way.

Anyone knows that problem and a way to solve it?

Thanx alot for your help...

Best
Thomas

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: problem with combination of set angle and rescale

Post by Klaus » Fri Jun 10, 2011 12:05 pm

Hi Thomas,

the sad truth is you cannot have both!
Image manipulation capabilities of LiveCode are, well, just LOUSY! :D

When you set the "lockloc" of the image to true, it will get distorted whan "angling".
And when you NOT "lockloc" the image it will resize to its original dimension AFTER
you resizued it and then set its angle.

The only advice I can give, try to change your app design to either let the user resize OR "angle" it.
Maybe you can create a snapshot of the user resized image and then use that for "angling"?

Sorry for the bad news, don't shoot the messenger, thanks 8)


Best

Klaus

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: problem with combination of set angle and rescale

Post by BvG » Fri Jun 10, 2011 1:24 pm

another workaround would be to set the size of your image, then set an empty image that has the same (resized) size to the imagedata of the first image. now you can rotate the second image, because it does only have that one size, and is not actually resized, so to say.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

Re: problem with combination of set angle and rescale

Post by Tomka » Fri Jun 10, 2011 1:58 pm

ok, let me see if I understand...

the problem seems to be that if I change the angle... the proportions of the imagedata will be set to its original values.

i dont understand your solution BvG :) ...

Let me explain my "project" a bit. I got 2 image of persons which have to be rotatable and resizeable (both is nessesary!).

Cause there are only 9 possible sizes (and I only use 2 different images) its maybe the best solution to make for each size a single img.file which would be loaded if the user changes the size. Would be only ( :shock: ) 16 more files :D ...

Whats your opinion about that?

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: problem with combination of set angle and rescale

Post by Klaus » Fri Jun 10, 2011 2:38 pm

Hi Thomas,

yes, that seems to be the best solution.
Remember that you can generate the necessary sizes "on the fly" in Livecode"!

I would eventually use a button and change its icon on the fly accordingly.
This way you could keep all image files invisible.
Just a quick thought :D


Best

Klaus

Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

Re: problem with combination of set angle and rescale

Post by Tomka » Sun Jun 12, 2011 5:45 am

Hi,

only want to say that the solution with the seperate img-files works fine. My project is nearly finished now :)

Thx alot Klaus :)


Best
Thomas

Post Reply