LiveCode and Quicktime movie resizing issue

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
homebase
Posts: 2
Joined: Thu May 12, 2011 4:37 am

LiveCode and Quicktime movie resizing issue

Post by homebase » Thu May 12, 2011 4:48 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: LiveCode and Quicktime movie resizing issue

Post by Mark » Sat May 14, 2011 4:19 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply