aspect-ratio

Image plot in bokeh with tight axes and matching aspect ratio

爱⌒轻易说出口 提交于 2019-12-10 04:26:51
问题 I'm using bokeh 1.0.1 version inside a Django application and I would like to display microscopic surface images as zoomable image plots with a color-encoded height and colorbar. In principle this works, but I have problems to get plots with the correct aspect ratio only showing the image without space around. Here is an example for what I want to achieve: The resulting plot should show an image of random data having a width of sx=10 and a height of sy=5 in data space (image size ) have axes

Is padding-bottom relative to element's width?

限于喜欢 提交于 2019-12-08 12:04:33
问题 Padding-bottom must be relative to element's width but i tested in last version of Chrome and Firefox and padding-bottom is relative to parent's width. I need a element relative to element's width but it doesn't work: width: 200px; padding-bottom: 50%; /* must be 100px */ height: 0; See example: http://dabblet.com/gist/6898263 What can i do? 回答1: No, in the padding properties, percentages are relative to the width of the containing block, which is here probably the body element or a div

Responsive iframe for different aspect ratio

梦想的初衷 提交于 2019-12-08 11:59:28
问题 I followed this post Making an iframe responsive to make iframes responsive. # A test case <div class="intrinsic-container"> <iframe frameborder="0" width="640" height="498" src="https://v.qq.com/iframe/player.html?vid=y0379t92gl9&tiny=0&auto=0" allowfullscreen></iframe> </div> # style.css .intrinsic-container { position: relative; /* padding-bottom: 56.25%; /* 16:9 */ padding-bottom:75%; /* 4:3 */ /* padding-bottom: 66.66%; /* 3:2 */ /* padding-top: 25px; */ height: 0; } .intrinsic-container

When using padding-top to retain aspect ratio for fluid layout, how do I vertically center text to background image?

馋奶兔 提交于 2019-12-08 11:30:39
I have not been able to find a solution to this and am willing to change whatever I need to as long as I can keep a couple things. The entire list element needs to be a link, the text within that link needs to be centered to the list item which has a background image. I need this fluid so I choose to use the padding-top to maintain the aspect ratio and to create the correct height. With using that padding top to create the height, I can not for the life of me figure out how to get the text vertically centered. I have seen a few other questions that addresses this issue somewhat but I have not

Floated columns not aligning correctly on certain screen sizes

橙三吉。 提交于 2019-12-08 09:48:27
问题 I have a problem with a CSS grid I built. The relevant site is this: http://dr-brauchle.de/ The wall of photos underneath the content is constructed with a grid of floated boxes. This works fine as long as all the boxes have fixed width and height values. To make the site responsive I use percentages on the width of the boxes and "auto" on their height and the same applies to the images that are loaded into these boxes. The media query jumps in at 1199px and converts the static box sizes to

How to scale height of views and postion of the views relative to the screen size using AutoLayout [closed]

↘锁芯ラ 提交于 2019-12-08 06:38:18
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Using Autolayout what is the best way to keep a view's relative position and scale to each screen size? For example there are drastic differences between the 4s and iPad Pro. What type of constraints and thought processes should I be using? The views being scaled may each have

resize view width, preserve image aspect ratio with CSS

烈酒焚心 提交于 2019-12-08 05:13:01
问题 I got interested in this from noticing how images are scaled when you resize the browser on "lightbox"ed images on Google+: https://plus.google.com/. below is a jsfiddle which when you resize the browser width, only resizes the image width and aspect ratio is lost: http://jsfiddle.net/trpeters1/mFPTq/1/ Can someone help me figure out what the CSS would look like to the preserve aspect ratio of this image? If you don't want to view the jsfiddle, here's the HTML: <div id="imgWrapper" > <div id=

Camera Preview does not appear full screen(displayed in a box)

妖精的绣舞 提交于 2019-12-08 02:41:49
问题 I would like to use a custom camera to take pictures of a lesser size than the preview,I have heard that maintaining the aspect ratio is very important.I have used the PreviewFrameLayout in AOSP ICS.I have found that the SurfaceView only displays at the center of the activity in a box and does not fill the entire screen. public class PreviewFrameLayout extends RelativeLayout{ static final String TAG="PreviewFrameLayout"; public interface OnSizeChangedListener { public void onSizeChanged(int w

How to stop window size jumping around when forcing fixed aspect ratio?

随声附和 提交于 2019-12-07 15:59:34
Here's my test code: import QtQuick 2.4 import QtQuick.Window 2.2 Window { visible: true readonly property int defaultWidth: 700 readonly property int defaultHeight: 500 width: defaultWidth height: defaultHeight readonly property real aspectRatio: defaultWidth / defaultHeight readonly property real scaleFactor: width / defaultWidth onWidthChanged: { var properHeight = Math.round(width / aspectRatio); if ( height !== properHeight ) { height = properHeight } } onHeightChanged: { var properWidth = Math.round(height * aspectRatio); if ( width !== properWidth ) { width = properWidth } } TextEdit {

Change Image() object dimensions (width and height)

此生再无相见时 提交于 2019-12-07 15:31:00
问题 I am attempting to resize an image's dimensions, whilst retaining it's aspect ratio. This seems like a very simple task, but I cannot find a rellevent answer anywhere.. (relating to JavaScript's Image() object). I'm probably missing something very obvious. Below is what I am trying to achieve: var img = new window.Image(); img.src = imageDataUrl; img.onload = function(){ if (img.width > 200){ img.width = 200; img.height = (img.height*img.width)/img.width; } if (img.height > 200){ img.height =