aspect-ratio

How Can I Only Allow Uniform Resizing in a WPF Window?

I don't want my window to be resized either "only horizontally" or "only vertically." Is there a property I can set on my window that can enforce this, or is there a nifty code-behind trick I can use? ...

How to maintain widgets aspect ratio in Qt?

How is it possible to maintain widgets aspect ratio in Qt and what about centering the widget? ...

Change tiff pixel aspect ratio to square

I'm trying to perform barcode recognition on a multipage tiff file. But the tiff file is coming to me from a fax server (which I don't have control over) that saves the tiff with a non-square pixel aspect ratio. This is causing the image to be badly squashed due to the aspect ratio. I need to convert the tiff to a square pixel aspect rat...

Whats the algorithm to calculate aspect ratio? I need an output like: 4:3, 16:9

I plan to use it with javascript to crop an image to fit the entire window. I appreciate all help you can provide. Edit: I'll be using a 3rd part component that only accepts the aspect ratio in the format like: 4:3, 16:9 ...

Aspect ratios - how to go about them? (D3D viewport setup)

Allright - seems my question was as cloudy as my head. Lets try again. I have 3 properties while configuring viewports for a D3D device: - The resolution the device is running in (full-screen). - The physical aspect ratio of the monitor (as fraction and float:1, so for ex. 4:3 & 1.33). - The aspect ratio of the source resolution (source...

wxwidgets/wxPython: Resizing a wxFrame while keeping aspect ratio.

I have a wx.Frame that has only a single child. While setting up the child's wx.Sizer, I can use the wx.SHAPED flag, which keeps the aspect ratio of the child locked. However, the Frame still has complete freedom in it's aspect ratio, and will leave a blank space in the area that is left unused by the child. How can I lock the aspect ra...

How do I find a dimension of aspect ratio 4:3 which fits within a predetermined size?

The problem here is I have a display window of size x by y, and I need to display an image inside the window without any scrolling, and to maintain the aspect ratio of 4:3. I have the following snippet of code: // Lock the current height, calculate new width of the canvas and scale the viewport. // get width of the movie canvas qreal wi...

Maintain the aspect ratio of an image ?

Hi, I am using pictureBox to show images which are received from server but my problem is that picture box in compact framework has only three Size Modes StretchImage, Normal, CenterImage the pictures i am getting are generally bigger in size so i have to use StrecthImage mode. But then the aspect ratio is maintained so the images s...

Resizing N # of squares to be as big as possible while still fitting into box of X by Y dimensions. (Thumbnails!)

I have N squares. I have a Rectangular box. I want all the squares to fit in the box. I want the squares to be as large as possible. How do I calculate the largest size for the squares such that they all fit in the box? This is for thumbnails in a thumbnail gallery. int function thumbnailSize( iItems, // The number of items to fit...

Resizing an image

The code below works very well for resizing an image by aspect ratio by height and I can also create a separate function by width. But i'm not always sure if an image will need to be shrunk by height or width. For example if the space that the image needs to be resized into is 100 width and 100 height and an image is 150 by 90 then its...

C#/WPF: Keep aspect ratio of UserControl?

Hello, Does anyone have an idea how to keep the Height/Width Ratio 1:1 of a UserControl? E.g. if Height > Width, Width & Height will have the same size and vice versa. Thanks for any help. Cheers ...

Image Resizing Question (PHP/GD)

I'm looking for help/suggestions in finding the most efficient way to resize an image to be as small as possible using PHP/GD while preserving the aspect ratio of the original image but ensuring the the resized image is bigger than a defined minimum width & height. For example, the resized image must have a width >= 400 and a height >= ...

How do I find the natural size/dimensions of a Flash SWF file?

I've been given a Flash file (.swf extension) to put into a web page. Opening the file in my browser makes it quite blurry, so I'm assuming there is a natural size for the file, same as an image. It's also rectangular so I need to work out the aspect ratio if I don't have an exact size. How would I find this information out? ...

How do I resize a Silverlight 3 application and all child controls and keep aspect ratio

Hi I'm building a Silverlight 3 application and I would like it to resize depending on the size of the web browser. I have found http://community.irritatedvowel.com/blogs/pete%5Fbrowns%5Fblog/archive/2008/07/04/How-to-Resize-a-Silverlight-2-App-and-Keep-the-Same-Aspect-Ratio.aspx But the solution suggested doesn't seem to work on s...

Setting a custom control's aspect ratio

Is there a way, using XAML (and possibly Template Bindings) to keep a control's width in a certain proportion to its height? I would like for my control, at design time in Blend, to always scale evenly. ...

Finding the correct scale value within a scaled object to maintain the aspect ratio of a video.

Hello, I have a video inside of another movieclip. When I go full screen, I scale up the outer movieclip to fit the screen. So that OuterMovieClip.width is equal to screenWidth etc. How do I maintain the aspect ratio on my video so it does not get distorted? Whats the proper math for that? Thank you. ...

Aspect ratio recommendation - use letterbox?

I'm doing some work in GD and I have a series of image sizes that I'm converting from my large 1920x1080 jpg. So for instance: 1920x1080 > 640x480 (4:3) 1920x1080 > 640x360 (16:9) 1920x1080 > 360x280 Should the best practice here to use a letterbox effect or fullscreen? With the letterbox I'll see more of the image, but the latter w...

Resize a WPF window, but maintain proportions?

I have a user resizable WPF Window that I want to constrain the resizing so the aspect ratio of the window stays constant. Ideally I would like to constrain mouse location when the window is being resized by dragging a corner to positions that maintain the proper aspect ration. If an edge is resized with the mouse, the other dimensio...

Get aspect ratio of a monitor

I want to get aspect ratio of a monitor as two digits : width and height. For example 4 and 3, 5 and 4, 16 and 9. I wrote some code for that task. Maybe it is any easier way to do that ? For example, some library function =\ /// <summary> /// Aspect ratio. /// </summary> public struct AspectRatio { int _height; /// <summary> ...

Resizing image with Python with locked aspect ratio

How should I resize an image with Python script so that it would automatically adjust the Height ratio to the Width used? I'm using the following code: def Do(Environment): # Resize App.Do( Environment, 'Resize', { 'AspectRatio': 1.33333, 'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels, ...