Page 1 of 1

LiveCode and Quicktime movie resizing issue

Posted: Thu May 12, 2011 4:48 am
by homebase
I am having an issue with resizing QuickTime movies in a player in LiveCode. If I resize the movie in QuickTime, it resizes dynamically and there is no problem with the image quality. When I do the same thing in a player object in LiveCode, I get distortion. It is particularly noticeable if the video includes any text. The font letters become noticeably distorted, as if the image were a bit map and it was stretched too large.

I tested this in a couple of other LiveCode players from the User Samples area, and it displays a similar pattern of behavior.

Is this a known issue? Is there a suggested workaround?

Also, is there an easy way to bring in the aspect ratio (640 x 480, 720 x 480 etc) and maintain it, when resizing. Right now this appears to require hand coding each time the window is resized.

Thanks.

Doug

Re: LiveCode and Quicktime movie resizing issue

Posted: Sat May 14, 2011 4:19 pm
by Mark
Hi Doug,

Can you get the formattedWidth and formattedHeight of the movie? The rescale function below calculates the new width and height.Parameters: 1) current formattedWidth, 2) current formattedHeight, 3) width of the destination area, 4) height of the destination area. The function returns two comma separated values, containing the new width and height, taking the aspect ration into consideration.

Code: Select all

function rescale theImgWidth,theImgHeight,theCdWidth,theCdHeight
  if theCdWidth/theImgWidth < theCdHeight/theImgHeight then
    put theCdWidth / theImgWidth into myRatio
  else
    put theCdHeight / theImgHeight into myRatio
  end if
  put theImgWidth * myRatio into myNewWidth
  put theImgHeight * myRatio into myNewHeight
  return myNewWidth,myNewHeight
end rescale
Best,

Mark