Menu
  • HOME
  • TAGS

Full height fluid image and div at one line. Div must take remaining horizontal space

android,css,internet-explorer-9,fluid-layout,aspect-ratio

I might be misunderstanding your question, but I think you mean how do you get the content div to take the rest of the row (regardless of what's in the left box). I think the solution has a few steps (assuming you can adjust the markup): Put the image into...

Java: How to control JPanel aspect ratio?

java,swing,jframe,jpanel,aspect-ratio

You may use a GridBagLayout and ComponentListener, For example: (inspired from: https://community.oracle.com/thread/1265752?start=0&tstart=0) public class AspectRatio { public static void main(String[] args) { final JPanel innerPanel = new JPanel(); innerPanel.setBackground(Color.YELLOW); final JPanel container = new JPanel(new GridBagLayout()); container.add(innerPanel); container.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { resizePreview(innerPanel, container); } });...

keep aspect ratio of .ui-dialog-content when resizing

jquery,jquery-ui,dialog,aspect-ratio,jquery-ui-resizable

That's because you are resizing (and keeping the aspect ratio of) the entire dialog. If you remove that .parent() call, you resize only the contents of the dialog window. But then, the dialog window don't resize with the contents, right? So you have to reset its size everytime you resize...

Css change percentages on aspect ratio

css,aspect-ratio

You could put everything in a wrapper div whose aspect ratio is maintained using the answer here (maintain aspect ratio of a div) Alternatively, or in conjunction, you could use CSS media queries to make the site display differently in response to different display sizes (width, height or both). This...

How to fix aspect ratio of a kivy game?

python,layout,resize,kivy,aspect-ratio

I managed to find a solution I was happy with with a lot of help from kived from the kivy chat. The below bases the game bounds on a 'background' image, then places a Relative Layout over this background image. For all subsequent children, the coordinate (0, 0) will refer...

How to take a photo of the same aspect ratio as in preview size?

android,android-camera,aspect-ratio

We can learn about general approach to this issue in this answer. Short quote: My solution was to first scale the preview selection rectangle to the native camera picture size. Then, now that I know which area of the native resolution contains the content I want, I can do a...

height: auto on SVG not working

css,svg,aspect-ratio

DEMO You need to define a viewBox on each element that you link to. because there can de different elements in one SVG document. So remove the viewBox from the element you link to. Add a viewBox to the place your linking from. I suggest you add the viewBox to...

CSS scale several images to fit viewport keeping aspect ratio

css,image,scale,aspect-ratio

Solution : FIDDLE (I striped most of your containers to make it simple to understand and work with) Explanation : NOTE : This solution is based on the fact that percentages (width and height) are relative the size of the parent element. Considering .section-images is a direct child of <body>...

Android Show Images while maintaining Aspect Ratio

java,android,image,aspect-ratio

You need a different android:scaleType in your layout. The ImageView.ScaleType documentation lists the different ones that are available. It sounds like you probably want to change matrix to fitCenter in your example.

Add value to WP Attachment Meta Data

wordpress,upload,orientation,attachment,aspect-ratio

You can write some code for it. Use http://codex.wordpress.org/Function_Reference/wp_get_attachment_metadata to get the width and the height, and then if $width/$height > 1 => landscape, otherwise its portrait. Store this value in the attachment using: http://codex.wordpress.org/Function_Reference/wp_update_attachment_metadata. You can use an action for this, such as: add_action('add_attachment', 'process_images'); Adding the solution as...

Qt layouts - Keep widget aspect ratio while resizing [duplicate]

c++,qt,layout,aspect-ratio

Your approach could work if this group box was inside vertical layout. As name says hasHeightForWidth is well defined when height depends on width (this was designed for text wrapping), not another way around (your case). What you can do? Try this (I've implemented something similar for QGraphicsWidget and it...

How to make my label one-third of my UITableViewCell through auto-layout

ios,objective-c,uitableview,autolayout,aspect-ratio

Just to add to @dreaming-in-binary's answer, IB may not allow you to set an equal width constraint against the content view (even though it is possible programmatically). Instead you could add a hidden reference view which spans the full width of the cell (i.e., has leading and trailing constraints to...

Calc Different video sizes with same aspect ratio

php,screen-resolution,aspect-ratio

<?php // create class to easily add and store resolutions class Resolution { public $x; public $y; } // create our original resolution and calculate its aspect ratio $origRes = new Resolution(); $origRes->x = 640; $origRes->y = 480; $originalRatio = ($origRes->x / $origRes->y); // create valid resolution $firstRes = new...

Changing image aspect ratio of interpolated RGB image. Square to rectangular

matlab,image-processing,aspect-ratio,fisheye

PART A To remove the requirement of a square input image, you may resize the input image into a square one with this - %%// Resize the input image to make it square reduced_dim = min(size(imR,1),size(imR,2)); imR = imresize(imR,[reduced_dim reduced_dim]); Few points I would like to raise here though about...

CSS a fixed-width image and one taking up the empty space

css,layout,aspect-ratio

HTML: <div class="image-container"> <div class="image"><img src="http://lorempixel.com/160/60/abstract/1"></div> <div class="image image-auto"><img src="http://lorempixel.com/100/60/abstract/1"></div> </div> <div class="image-container"> <div class="image"><img src="http://lorempixel.com/60/60/abstract/1"></div> <div class="image image-auto"><img src="http://lorempixel.com/1000/60/abstract/1"></div> </div> <div...

Fixed thumbnail ratio size & maintaining aspect ratio?

html,css,thumbnails,aspect-ratio,ratio

I think This is the result you are trying to acheive. I added a div.img-wrapper around each thumb and some css magic HTML <div id="container"> <div class="col-4"> <div class="img-wrapper"> <a class="thumb" href="#"> <img src="http://mintywhite.com/wp-content/uploads/2012/10/fond-ecran-wallpaper-image-arriere-plan-hd-29-HD.jpg"> <div class="caption">Project untitled<br> Category</div> </a> </div> </div> <div class="col-4"> <div class="img-wrapper"> <a...

why does Ruby's Rational class treat string arguments differently from numeric arguments?

ruby,aspect-ratio,rational

Disclaimer: This is only an educated guess, based on some knowledge on how to implement such a feat. As Kent Dahl already said, Floats are not precise, they have a fixed precision, which means 1.91 is really 1.910000000000000000001 or something like that, which ruby "knows" should be displayed as 1.91....

How to control aspect ratio with both continuous and discrete axes with geom_tile in ggplot2?

r,ggplot2,aspect-ratio

I'm not sure I quite understand your question, but I think this is what you want: p <- ggplot(my, aes(factor(x), y)) + geom_tile(aes(fill = z)) + scale_fill_gradient(low = "white",high = "steelblue") + theme_grey() + labs(x = "", y= "") + coord_fixed() + theme(axis.ticks = element_blank()) print(p) I converted your x...

Floated columns not aligning correctly on certain screen sizes

responsive-design,css-float,aspect-ratio,css

So what I found is that you need to force an aspect ratio. Try modifying the following styles: .box-1 { width: 25% !important; height: 0; display: block; overflow: hidden; float: left; background-size: cover !important; line-height: 0; position: relative; padding: 13.75% 0 0 0; } .box-1 img { width: 100% !important;...

Resize control to match aspect ratio

c#,winforms,resize,aspect-ratio

Here is a little testbed. Put a control on a form and assign the ViewPort variable to it. Here I chose a textBox1 but any control will do. Then pick a target aspect ratio, I chose TargetRatio_3_2. Try it by resizing the form! Note 1: I chose a form as...

Showing pdf in Xamarin apps

android,ios,pdf,xamarin,aspect-ratio

Before Android L there is no way to display PDF without using a 3rd party library. In iOS you can use the native document viewer using UIDocumentInteractionController. The class is exposed in Xamarin.iOS so you should be good to go on that one.

Fit responsive square in viewport according to width and height

css,css3,responsive-design,aspect-ratio,square

To fit and center a square div in the viewport according to it's width and height, you can uses one HTML tag with : vmin units for the sizing : vmin 1/100th of the minimum value between the height and the width of the viewport. (source : MDN) absolute positionning...

Maintain aspect ratio of a div according to height

css,responsive-design,fluid-layout,aspect-ratio

As % padding/margin are calculated according to the width of the contrainer, you can't use the "padding technique" to maitain aspect ratio according to the height. For a CSS solution, you will have to use vh units : vh : 1/100th of the height of the viewport. Source For browser...

How to set aspec ratio with EVR in DirectShow?

video,directshow,aspect-ratio,directshow.net

You cannot instruct EVR to override aspect ratio, it only has option to maintain AR or not. If you want to change aspect ratio of displayed video, you have to workaround methods instead: You can transform the video feed and change media type of the stream leaving payload intact and...

CSS resizable images with header

html,css,image,resize,aspect-ratio

Firstly, you can set max-width: 100%; and height: auto; on the image tags instead of hardcoding the height and max-widths on each image. Then you can set top: 40px; on the .halfContainer divs to make the container start 40 pixels down. Finally, set the max-height of the images to calc(100vh...

Correct aspect ratio in Android

android,android-camera,aspect-ratio

Unless there is a bug in that code, you are getting the 'best' result possible. The aspect ratio of the phone's camera is not guaranteed to match that of the phone's screen. It is just a matter of deciding what the criteria are for the best result. That code is...

How to force a responsive element to retain its aspect ratio

html,css,html5,css3,aspect-ratio

What is the CSS padding trick? First some information about containing blocks for reference. 9.1.2 Containing blocks In general, generated boxes act as containing blocks for descendant boxes; we say that a box "establishes" the containing block for its descendants. The phrase "a box's containing block" means "the containing block...

Fit image to top of screen, fill width, keep aspect ratio

ios,image,aspect-ratio

The problem is that you still lack a constraint. You can add another constraint such as height, or aspect ratio. However, when you add a constraint for aspect ratio, it would fill up the whole screen when in landscape. Unless, you're only using portrait, aspect ratio is fine. If you're...

Adjust height of image to 100% width without altering aspect ratio

css,image,responsive-design,aspect-ratio

You have to give a max-width:100% to your img. Plus background-size only works when you are working with background-images. Since you are applying max-width to your img there is no need to apply max-width to its parent #header Last, but not least try not use min-height and height:auto at same...

Markers are not Perfect Circles?

matlab,aspect-ratio

You can achieve your desired behavior by calling axis equal before you set the axis limits. While you set the axis range to equal values, your aspect ratio can be off. Therefore, the circular markers may not touch. Here's an example based on your approach (slightly modified for simplicity): figure;...

FFmpeg - Change resolution of the video with aspect ratio

video,ffmpeg,resolution,aspect-ratio

Answer is here, in ffmpeg maual https://trac.ffmpeg.org/wiki/Scaling%20(resizing)%20with%20ffmpeg

How to center panel with controlled aspect ratio

python,wxpython,wxwidgets,aspect-ratio

As VZ explained in his answer, your wxEVT_SIZE handler isn't a very good idea. Remove it. When using sizers, you have to work within the sizer infrastructure to achieve what you want. You want your TestGrid to fill as much space as possible within its parent, while maintaining a certain...