Do not use on any
shared computer
July 25, 2008 03:09pm pdt
null
[x]
Attachment Details

Resize a java.awt.Component and maintain Aspect Ratio

Tags: ratio, aspect, resize, maintain
Hi Experts,

I have a awt.Component that comes from JMF using MediaPlayer.getVisualComponent(). I can dsiplay this Component in a JFrame without any problems.
But I need to resize this Component larger than what it is and maintain its Aspect Ratio.
Would it be possible to to have a MyComponent class and override paint()??
I found a solution that uses a ScaledLayout manager but  the quality is reduced as the width/height ration is a 1.2123 approx and calculating to get the new width/height changes the ratio due to having to resize using values of type int.

Any ideas???
Thanks.
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: Cuchulan
Question Asked On: 09.27.2007
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by sciuriware

Rank: Sage

Expert Comment by sciuriware:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by sciuriware

Rank: Sage

Expert Comment by sciuriware:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Cuchulan
Author Comment by Cuchulan:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by sciuriware

Rank: Sage

Expert Comment by sciuriware:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628