JW Player responsive based on height - responsive-design

How can I make my JWPlayer responsive based on a height (not a width) and then center it?

Related

Chart is being resized not proportionally

I use Chart on Windows Forms. And I've noticed, chart is being resized not proportionally. Why is it so and how can I change it. For better understanding look at follow pictures (Chart's width x height in top left angle)

Scale UI proportionally in a fixed position Unity C#

I am new to Unity and C# and I am currently making a little useless game just to learn it.
My struggle now is to get the scale right for a level indicator. I have made a UI Image with the indicator background as a child of UI Panel inside of the Canvas. What I want is to scale the image proportionally while the position is being maintained in the bottom left corner of the view.
This is how I want it to scale.
If the view is wide, it would be like this, 200px x 200px.
If the view is narrower I want the image to be smaller, but with the same ratio. If the width of the narrow view is one third of the wide view, i want the image to be 67px x 67px. I do not want it to be scaled by the heigth of the view.
Does anyone know how this can be done?

Scaling to be a specific height in Unity

I have a game like Pong, except you control both paddles and try to keep the ball in bounds. I want the paddle to always be 1/3 of the height of the screen for all resolutions. So if the Height = 900, then the paddle should be 300 high. For some reason, I can't seem to find a way that works for all resolutions anywhere. I feel I need to accomplish this through a script. Here is an image of the components for my paddle.
I need a generic formula so the paddle height is always 1/3 of the screen height.
Thanks in advanced for any help!
Get the canvas height and assign the paddle sizeDelta to have y size equal to the canvas height divided by 3.
This is the script, assumed you attach it to the paddle:
public Canvas myCanvas;
void Start() {
float canvasHeight = myCanvas.pixelRect.height;
GetComponent<RectTransform>().sizeDelta = new Vector2(GetComponent<RectTransform>().sizeDelta.x, canvasHeight/3f);
}

How to play video in a frame without cutting video using MPMoviePlayer

Is there any way to fill video without stretching and cutting the video ?
1- MPMovieScalingModeFill - its stretching video.
2- MPMovieScalingModeAspectFill - its cutting video.
3- MPMovieScalingModeAspectFit - its shooing video in centre and showing black area.
No. Think about it! The MPMoviePlayerController's view is not the same aspect (ratio height to width) as the movie. So to make it fit, either you must cut some off (of either height or width), or you must letterbox it (black area) with one dimension being too small, or you must distort.
You should do the opposite: size the MPMoviePlayerController's view to fit the aspect of the movie!

How to resize a Canvas in WPF?

I'm writing a WPF app that has a Canvas in it. This canvas will be custom rendered at runtime. It's sort of like a game in that it needs to be measured in pixels. I need to be able to set my Canvas to 478x478 pixels (client rectangle size). I don't want any scaling or other resolution-independent steps to take place on my Canvas.
I'm not sure if this is possible in WPF, since its nature is to be resolution independent. My questions:
How do I resize my Canvas at runtime (function to call?)
When I resize my Canvas, is the renderable area (the client rectangle) going to be that size? If not, how can I resize it to make sure the client rectangle is a specific width/height?
Is it possible to set the width/height of the Canvas in Pixels? How does the resolution-independent aspect of WPF interfere with what I'm trying to do?
When I resize my Canvas, will other controls resize appropriately as they have been designed to do in the WPF designer?
Thanks in advance.
Any elements positioned in a canvas will not resize or reposition based upon the size of the canvas. So I don't think there's any advantage to setting the size of the canvas. Maybe you should just set a fixed size of the window instead.
Otherwise, just set the Canvas.Width, Height, and ClipToBounds=True and you have a fixed sized canvas that positions its child elements with X/Y coordinates.
Also you should be sure to set SnapsToDevicePixels=True on the canvas so that child elements will have crisp pixel-aligned bounds.
resizing is cake:
MyCanvas.Width = 350;
MyCanvas.Height = 450;
this sets the size, you CAN render to coordinates outside of this, but it will be clipped. You can wrap your canvas inside a scroller to allow the user to see what is outside the height/width of the canvas.
as for the rest of your questions, i think you can see this SO question for your answers

Resources