aspect-ratio

Fixed thumbnail ratio size & maintaining aspect ratio?

删除回忆录丶 提交于 2019-12-11 19:33:05
问题 There are some questions that are properly similar, but i can't relate it to my specific situation. I have created a responsive thumbnail grid with 4-to-3-to-2 columns structure (in percentages 25%-33,33%-50%). I'm using a fake placeholder image of 500x330px for testing, but i would like to have a fixed thumbnail placeholder (css code?) with a responsive 500x330 ratio and maintain the aspect radio of the images placed in centered (vertical and horizontal) the placeholder thumbnail. In the

CSS vertically align div while maintaining aspect ratio

怎甘沉沦 提交于 2019-12-11 18:57:36
问题 I used the JsFiddle at jsfiddle.net/5tzk3/10. I changed it to display the div as square shaped dialog (both horizontally and vertically centered). The result is at jsfiddle.net/5tzk3/548. As you see, centering horizontally was easy, but I could not get it centered vertically. Anyone who knows how to do that with pure CSS? Edited code below: <div class="blind"> <div class="wrapper"> <div class="main"> I'm your div with an aspect-ratio of 1:1! </div> </div> </div> html, body, .blind { height:

JavaFX: How to resize a rectangle with set aspect ratio

北慕城南 提交于 2019-12-11 17:44:44
问题 I have an app where user can draw a rectangle, and resize it or move it. I'm interested if is possible to some how bind rectangles width and height in some aspect ratio. E.g. if aspect ratio is 1:2 that user can draw only that kinds of rectangles, or if is 1:1 that user can only draw square. EDIT My eventHandler for MOUSE_DRAGGED event looks something like this EventHandler<MouseEvent> onMouseDraggedEventHandler = event -> { if (event.isSecondaryButtonDown()) return; double offsetX = event

Changing UI Image's sprite, preserve aspect ratio is checked but not working? Unity 2019.1.0f2

百般思念 提交于 2019-12-11 17:30:41
问题 Changing UI Image's sprite, preserve aspect ratio is checked but not working. Version: Unity 2019.1.0f2 What happened I updated to the latest software update for Unity which is Unity 2019.1.0f2. Before when it was version 2018.3.12f, the UI Image's sprite changes normally. But now when I have updated it, it doesn't regain its aspect ratio and gets stretched. When the sprite changes on the UI image, the aspect ratio/width and height changes for the image and when you go back to the original

Smaller range padding for image plot with bokeh

两盒软妹~` 提交于 2019-12-11 16:31:12
问题 I'm using bokeh 1.0.4 and I would like to generate an image plot in bokeh using match_aspect=True . Here is a example code for illustration: from bokeh.models.ranges import DataRange1d from bokeh.plotting import figure, show import numpy as np arr = np.array([[1,2,3],[4,5,6]]) plot = figure(match_aspect=True) plot.image([arr], x=0, y=0, dw=3, dh=2) show(plot) This is what I get: There is a lot empty space around the data, too much for my application, and I would like to have the axes more

Make video fill screen and keep aspect ratio

烂漫一生 提交于 2019-12-11 11:45:53
问题 Java and C# (Xamarin.Android) accepted I have a MediaRecorder that streams the cameraframes onto a TextureView (basic camera2 approach) the TextureView fills my screen. I want the video to fill the screen but keep the aspect ratio. I know I have to eventually cut of either left/right or top/bottom parts of the video, to keep the aspect ratio. How can I make the video fit the TextureView and "zoom in" until the whole screen is filled? I don't want "black bars" that compromise for the ratio to

Android - Keep aspect ratio on background image on default Button

[亡魂溺海] 提交于 2019-12-11 09:19:21
问题 Is there any way to maintain the aspect ratio of a drawable when applied as background on a Button (cannot use ImageButton (need possibility for text on the Button ), cannot use setCompoundDrawables() , because that also doesn't meet my requirements (I made my own class to support adding backgrounds while still retaining the original android default button, plus I need to set te background in the middle of the button, not left, right, top or bottom)). I tried a solution with a ScaleDrawable ,

How to make a photo zoom, setting aspect ratio and then zooming leaves white area in Swift?

三世轮回 提交于 2019-12-11 08:36:32
问题 [After scrolling : Problem White Screen]1 After Zooming [Before Zoom image setted aspect ratio] I am implementing a photo view page, which includes just a photo. Functionalities : Zoom. As the image is of size 1024x510. I have implemented aspect ratio and set the imageview frame to the screensize. I have implemented using Scrollview and imageview concept. The problem is that, when I zoom the image white screen is also zoomed. Problem is the white space os imageview while zooming. . Code

optical aspect ratio not consistent with supportedPictureSizes

有些话、适合烂在心里 提交于 2019-12-11 07:46:30
问题 I have discovered that certain tablets (e.g. Samsung SM-T210 - Galaxy Tab 3) have equal horizontal and vertical angles of view (implying aspect ratio = 1), while NONE of their camera1.parameters supported picture sizes have an aspect ratio of 1 (closest being 1.33). What's going on? Are pixel pitches different in the x and y directions? Is come kind of cropping always applied? I am testing an augmented reality app, and I need to have a very clear understanding of how an optical point maps

Translating X,Y Coordinate

…衆ロ難τιáo~ 提交于 2019-12-11 06:16:39
问题 I currently have a user control that contains items that have a certain X, Y coordinate and there are limits to what those points must be within. In this case those positions are 0 > X > 40 and 0 > Y > 80 (40x80). The control I am hosting those items in is dynamic but has a certain aspect ratio based on window size. I need to translate those X & Y coordinates into relative locations within the user control. Any help is greatly apprecaited! Thanks in advance! If it matters/helps, I'm using