stretch

Stretch html5 video without keeping aspect ratio in jQuery

天大地大妈咪最大 提交于 2019-12-06 03:32:07
HTML5 videos have intrinsic aspect ratios and tend to keep it, no matter what your CSS tells them to do. I have a responsive video container that isn't 16:9, and I'd like the videos inside it to stretch to 100% width and 100% height, even if it breaks their original aspect ratio. I've read about the CSS object-fit: fill property, which would solve my problem, but there's still a long way to go before modern browsers support it. So I guess I must turn to JavaScript to achieve what I need. I came across this fiddle: http://jsfiddle.net/MxxAv/ function scaleToFill(videoTag) { var $video = $

Resizing images

余生长醉 提交于 2019-12-06 02:11:27
I'm working on a forum application in PHP. In signature field I have " <img src='randomimage.png'><br>bla blah " If an image is bigger than the field it stretches my tables and looks bad. Is there any way to re size the image if its too big? Sorry for my poor English and thank you for reading Edit: The thing is that it's not only the image. It's the image and the text "the big text". Respectfully, Tom Sampson PHP... You can re-size images with the gdlibrary (See: PHP/GD - Cropping and Resizing Images ), but that may be complicated if you're not already pretty familiar with PHP. jQuery

Java Printing Font Stretch

杀马特。学长 韩版系。学妹 提交于 2019-12-05 15:22:42
I just got the printer to work in java how I need it too, but there's one last problem I need to solve. When it prints, the font's width is rather stretched, and not crisp and clear like it should be. Here is my code my the actual drawing to the paper: FontMetrics metrics = graphics.getFontMetrics(font); int lineHeight = metrics.getHeight(); arrangePage(graphics, pageFormat, lineHeight); if (page > pageBreaks.length){ return NO_SUCH_PAGE; } Graphics2D g = (Graphics2D) graphics; g.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); g.setFont(font); int y = 0; int begin = 0; if

How do I make a StringGrid's columns fit the grid's width?

孤街浪徒 提交于 2019-12-05 09:04:05
I've been looking for a long time for a solution without any luck. Does anyone know a simple way to do that? I would like to stretch for example the second colum of my grid to fit the grid's width! Use the ColWidths property, like so: with StringGrid1 do ColWidths[1] := ClientWidth - ColWidths[0] - 2 * GridLineWidth; And for a more robust and flexible solution, take all fixed columns into account and parameterize the column index: procedure SetColumnFullWidth(Grid: TStringGrid; ACol: Integer); var I: Integer; FixedWidth: Integer; begin with Grid do if ACol >= FixedCols then begin FixedWidth :=

Add Transparent and stretched Image to Imagelist in Delphi

ぐ巨炮叔叔 提交于 2019-12-05 04:11:00
问题 According to my previous question with the help of Cosmin Prund, I found how to stretch Image and add to ImageList: procedure LoadDatasetImagesToImageList; var StretchedBMP: TBitmap; MS: TMemoryStream; begin ImageList.Clear; ItemsDts.First; StretchedBMP := TBitmap.Create; try // Prepare the stretched bmp's size StretchedBMP.Width := ImageList.Width; StretchedBMP.Height := ImageList.Height; // Prepare the memory stream MS := TMemoryStream.Create; try ImageBitmap:= TBitmap.Create; try while not

spinner expanding beyond screen bounds

ぐ巨炮叔叔 提交于 2019-12-04 05:27:38
问题 I have a layout that contains a TableLayout with three rows. Each row has a TextView and a Spinner. The Spinners' column is set to stretch. My problem is that the Spinners are stretching off the edge of the screen when they contain a long string. I would like them to truncate the string instead. Here's a screenshot of the problem: http://www.comicfanboy.net/images/screenshot.png and here's the xml for the layout: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android

Stretch Grid to window size

与世无争的帅哥 提交于 2019-12-04 03:40:40
问题 I've just started learning C# WPF with a basic empty project and I want to make a grid, with a background image, which stretches exactly over the window. The way it is now, the grid stretches, but not the way I want it. For example my background image is 1000x1000px and my window size is 1700x1200px so the grid stretches to 1200x1200px (it keeps the aspect ratio of the image. I don't want this, I want it simply to stretch all over the window. Here is my code: <Window x:Class="Backgammon

Add Transparent and stretched Image to Imagelist in Delphi

流过昼夜 提交于 2019-12-03 20:55:58
According to my previous question with the help of Cosmin Prund, I found how to stretch Image and add to ImageList: procedure LoadDatasetImagesToImageList; var StretchedBMP: TBitmap; MS: TMemoryStream; begin ImageList.Clear; ItemsDts.First; StretchedBMP := TBitmap.Create; try // Prepare the stretched bmp's size StretchedBMP.Width := ImageList.Width; StretchedBMP.Height := ImageList.Height; // Prepare the memory stream MS := TMemoryStream.Create; try ImageBitmap:= TBitmap.Create; try while not ItemsDts.Eof do begin if not ItemsDtsPicture.IsNull then begin MS.Size := 0; ItemsDtsPicture

WPF: How to make controls stretch in a StackPanel?

谁说胖子不能爱 提交于 2019-12-03 14:54:58
问题 A Slider and some other controls won't stretch to fill available space when placed in a StackPanel; instead the width is always MinWidth (or about 10 pixels if MinWidth is not set). How do I make it stretch (the equivalent of Anchor.Left|Anchor.Right in WinForms)? Example: <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"> <Slider Value="14" SmallChange="0.5" Maximum="100" Minimum="4" x:Name="FontSize" MinWidth="30" LargeChange="2" TickFrequency="10" TickPlacement="TopLeft"

CSS background stretches to fill height in iOS but there is white space on scroll

北城余情 提交于 2019-12-03 14:14:52
问题 this CSS gets my background to fill 100% of the screen height in iOS but there is a minor problem - when you scroll down there is initially white space, then when you release your finger and stop scrolling the background image "adjusts" and fills 100% of the screen height again. The problem does not re-occur on the same page if you continue to scroll, just the first time. Could someone please help? Thanks #background { background: url(../img/background.jpg) center repeat-x; position: fixed;