w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to reconcile difference in aspect ratio between camera preview size and picture size
I'm not too sure of what you're asking for, but the preview size actually is not determined by your layout. How it is displayed is determined by the layout. I'm assuming that you are using a SurfaceView to hold your preview/camera object. You can get the actual preview size with this method http://developer.android.com/reference/android/hardware/Camera.Parameters.html#getPreviewSize() And additionally, you can get the dimensions of your "displayed" preview by using the width and height you get from onSurfaceChanged() (It is part of the surfaceholder callback) I'm not sure how important that is. But the main point is now that you know the actual preview size from getPreviewSize() you can do math and get your points accordingly. This matches perfectly with onPreviewFrame(byte[] data, Ca

Categories : Android

How to align picture in center and assign its size mode to auto size at the same time?
You can try using this simple Panel control that will handle the two requirements for you: public class PanelImage : Panel { private Image image; public PanelImage() { this.DoubleBuffered = true; this.ResizeRedraw = true; } public Image Image { get { return image; } set { image = value; if (image != null) { this.AutoScrollMinSize = image.Size; } this.Invalidate(); } } protected override void OnPaint(PaintEventArgs e) { e.Graphics.Clear(Color.White); if (image != null) { Point p = this.AutoScrollPosition; if (image.Width < this.ClientSize.Width) { p.X = (this.ClientSize.Width / 2) - (image.Width / 2); } if (image.Height < this.ClientSize.Height) { p.Y = (this.ClientSize

Categories : C#

Automatically changing font size as parent control changes size
How about this - it has the view box in each grid cell and a textbox as it's content. It will resize the content as you resize the app <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="286" Width="440"> <Grid> <Grid.RowDefinitions> <RowDefinition ></RowDefinition> <RowDefinition ></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinitio

Categories : C#

takePicture failed when picture is taken automatically but works on button click
Preview must be started before you can take a picture. Where is your startPreview() ? In addition, they all run in main thread, you cannot make callback work instantly when you make initialization and register the callback.

Categories : Android

How to reduce picture size?
Why you are writing the image two times just do it in all one time What i do BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 4; Bitmap myBitmap = BitmapFactory.decodeFile({ImagePath}, options); FileOutputStream fileOutputStream = new FileOutputStream({ImagePath}); BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream); myBitmapClose.compress(CompressFormat.JPEG, imageQuality, bos); if (bos != null) { bos.flush(); bos.close(); } if (fileOutputStream != null) { fileOutputStream.flush(); fileOutputStream.close(); } It will definitely compress Mind the line myBitmapClose.compress(CompressFormat.JPEG, imageQuality, bos); where set imageCompression type CompressFormat.JPEG

Categories : Android

Adjust font and picture size
This is where media queries come into play, in your css you set the thresholds/breakpoints and apply different styling accordingly For example : @media screen and (min-width: 320px) and (max-width: 599px) { .menu_font { font-size:10px; /* set the size as you see fit*/ } } ==Edit to make more sense== /* menu ----------------------------------------------------------*/ @media screen and (min-width: 320px) and (max-width: 599px) { ul.menu { font-size: 0.75em; font-weight: 600; margin: 0 0 5px; padding: 0; text-align: right; } }

Categories : HTML

Winform auto size to picture box
There is one built-in property that could help you - Size Mode. Try it and if this does not suit your needs you can implement your own method for this - click me!

Categories : C#

Does the css applied to a picture reduce its file size?
CSS is applied by the user's web browser, which is running on their local PC. After the web browser downloads the image, it only then applies the CSS scaling to display it smaller than the actual image size. As a result, the answer is no. The user must download the entire file, even if CSS is used to resize it smaller. To make the image smaller before sending, you can use a server-side language such as PHP, and generate a thumbnail of the image that is the appropriate final display size. This not only will make your page load faster, but will reduce bandwidth requirements as well.

Categories : HTML

Take high supported picture size in android
it's solve and it's corrected method : public void GetHighResolutionForCamera(){ int Max = 0; Parameters params = mCamera.getParameters(); List<Camera.Size> resolution ; resolution = params.getSupportedPictureSizes(); Camera.Size MR = resolution.get(0); for (Camera.Size size : resolution) { if(Max < size.height){ MR = size ; Max = size.height; } } params.setPictureSize(MR.width, MR.height); mCamera.setParameters(params); } problem because MR was null

Categories : Android

rule of picture/preview size in Android Camera
Image sizes that are multiple of 16 pixels are preferred because: 1. Most of the pictures taken are saved on the phone/SD card with JPEG compression. Also, the compression for videos is based on JPEG (MPEG-4). The JPEG compression algorithm splits the image into blocks of 8x8 pixels, so 8 pixels is actually the lowest limit, also preferred. If the image resolution isn't a multiple of 8 pixels (on both width and height) the encoding algorithm pads the image until this is achieved. This is expensive memory-wise and can complicate the encoding process for certain images/videos. Sometimes you need to have a 16 pixel multiple due to sub-sampling (considering one of every two pixels) for video compression. [JPEG codec example] 2. Alterations(rotations/flips) to a JPEG image can be done without

Categories : Android

java android why picture's dimensions are distorted and how to use actual size?
in my project,i used "weight" to proper different android device,first you should set height is 0px;then set weight for imageview with proper value, and keep "fitxy" or use "centerCrop" to crop this image;

Categories : Java

Adjust automatically the size of div
text seems to be a reserved word, you're not allowed to use as a class name. After changing it, the fiddle works great. Altered CSS: .text1{ border: 1px solid red; height:150px; width:auto; }

Categories : CSS

Can WeasyPrint fit to Paper Size Automatically
WeasyPrint does not support anything like this at the moment. Prince’s documentation is pretty sparse on what it does exactly. How is "the width of the content" determined? Given a proper specification of the feature, I could tell how hard it would be to add to WeasyPrint. By the way, I do not usually watch StackOverflow for WeasyPrint question. Writing to WeasyPrint’s mailing list or issue tracker will get more response.

Categories : Python

Automatically increasing font size in Swing
Some L&Fs support a sizeVariant, illustrated here with com.apple.laf.AquaLookAndFeel. Alternatively, you can scale the font to fill the space allocated by your chosen layout, as shown here.

Categories : Java

UIScrollView starts automatically in double size
To do this, you will have to use the setZoomScale:animated: method of UIScrollView. Confusingly, this method will not work unless you have a (non-nil) delegate set for your scroll view, which responds to -viewForZoomingInScrollView. Read the UIScrollView documentation for how to do this. For more info, you can also read this section about handling zooming with a UIScrollView.

Categories : IOS

how to automatically resize image to screen size from alt attribute and not src
try this <script type="text/javascript"> $(document).ready(function () { var browserHeight = $(window).height(); var browserWidth= $(window).width(); $('.fullscreen').css({ height: browserHeight , width: browserWidth }); }) </script> <img id="imgg" class="fullscreen" src="images/album/thumbs/1.jpg" alt="images/album/1.jpg" height='' width=''/>

Categories : Javascript

Automatically fill command line input of variable size
yes $'a b' | script.py Uses bash's $'...' syntax for string literals which contain escape sequences. Alternatively: while true; do echo a; echo b; done | script.py

Categories : Python

How to generate thumbnails automatically with uniform size from orginal images?
You can use the same image with a lower height and width attribute as your thumbnail image. <img src="http://i.stack.imgur.com/AziqE.png" height= "10" width = "10" alt = "test image"/>

Categories : Javascript

Height of the list item should automatically increase with size of div inside it
You will have to add the following for it to work: li{overflow:hidden;} When setting the parent of a floated element to overflow:hidden; you force it to wrap the entire floated content. This is a very useful technique and it is used alot.

Categories : HTML

Using facebook graph api how to get news feed with large picture size if the feed type is photo?
I'm currently searching for the same thing. I know you can swap _s for _n at the end and get a larger size... but I haven't figured out how to have the api return the larger size on its own.

Categories : Facebook

Clickable picture array image output size - can't control dimensions of individual output pictures
you can change an image's size by its height and width properties. Note that this resizes the image, and can be subject to warping. It is suggested that you resize a large image to smaller thumbnails, because it is extremely wasteful to request a huge image then to style it to be a small thumbnail image. You can rather easily create a script that will resize images for you to an number and combination of sizes

Categories : Javascript

capture picture from linux command line (uvccapture captures black picture)
a bit of an odd suggestion, but have you tried using sudo uvccapture -S40 -C30 -G80 -B20 -x1280 -y720 -v -t0 That should just take a single shot. Try this and see what it comes back with. I find that sometimes uvccapture wants that extra parameter. Not always though. Cheers. ARc

Categories : Linux

Taking a picture doesn't save the picture in the gallery
You are getting External storage. Instead save your image with this: MediaStore.Images.Media.insertImage(getContentResolver(), Bitmap, Title, Description); This will save the image in gallery. See insertImage(). Parameters cr The content resolver to use image Path The path to the image to insert name The name of the image description The description of the image Returns The URL to the newly created image

Categories : Android

AngularJS - What's the best way to implement a "picture-in-picture" view within my stated app?
Define abstract ListIndex state with ui-view directive to hold child states. Define ListCategory state that is child of ListIndex with resolve object to access category info in your controller List and Item controllers. Define ListCategoryItem state that is child of ListCategory. Some quick sample code: states.ListIndex = { url: '/list', abstract: true, template: '<div ui-view/>' }; states.ListCategory = { url: '/list/:categoryId', controller: ['$scope', 'category', function($scope, category) { $scope.category = category; }], templateUrl: 'category.html', resolve: { category: ['CategoryService', '$stateParams', function(CategoryService, $stateParams) { return CategoryService.get($stateParams.categoryId); }] }; states.ListCategoryItem = { url

Categories : Javascript

Changing the name of a picture makes the picture looks small
May be there are two images like one Publictransportation.png present in resources and another one will be just reference of Publictransportation.png, which might me there on your machine. Search Publictransportation.png in your project and check for duplication.

Categories : Image

Automatically size TextBlock length to length of characters (in a Grid)
Try setting the HorizontalAlignment of the TextBlock to the left of the grid. <TextBlock x:Name="NewLabelButton" HorizontalAlignment="Left" Text="Add New" Width="Auto" Foreground="Blue" TextDecorations="Underline" MouseLeftButtonUp="AddNew_OnClick" VerticalAlignment="Center"/>

Categories : C#

how to have a picture in a picture-box change every 10 seconds
A couple of things: If these images aren't too big and plentiful you should consider preloading them all before hand: Dim images As New List(Of Image)() images.add(Image.FromFile(Somefilepath)) Now create a Timer that will tick every 10 seconds: Dim pictureChangeTimer As New Timer() 'Creates a timer AddHandler pictureChangeTimer.Tick, AddressOf pictureChangeTimer_tick 'creates an event handler, simply type in pictureChangeTimer.Tick += and hit tab twice. this will automatically create the method for you ' Sets the timer interval to 10 seconds. myTimer.Interval = 10000 myTimer.Start() Now in a separate function you can change your pictures every time the event lauches Private Sub pictureChangeTimer_tick(sender As Object, e As EventArgs) 'if using a lis

Categories : Vb.Net

Put a lot of pictures together to make one picture, how to use the picture which you want
check this out it will help you alot... http://spritegen.website-performance.org/ also this for techniques... http://coding.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/

Categories : CSS

Replace a button with a picture when clicked and then create a new button on top of picture in WPF
Here's a quick, rather crude example, but it shows some basics of adding and positioning controls at runtime. Things to note: Add controls to a Canvas if you want to be able to position x,y explicitly. I used UserControls for location items, and just added instances If you're building a game, and if it's any significant size and complexity, don't use WPF. I've been there, done that, built a full multiplayer space arcade/action game on it. It's too slow for games. Here's the code dump below. //PathBuilding.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TravianResourceProd" x:Class="TravianResourceProd.PathBuilding" Title="PathBuildin

Categories : C#

Is the size of a union equal to the size of its member of the largest size?
Looking at the Cx0 standard it says: The size of a union is sufficient to contain the largest of its members So, you cannot rely on the size being equal to the size of the largest member. Whether it is on not depends on the compiler implementation, flags used, etc.

Categories : C

tinyint(size), varchar(size): "size" explaination
Your Solution to confusion is- In Mysql , int(6) doesn't mean they can store up to 6 digit. not more than 999999. However CHAR(6) This means a character column, with a maximum length of 6 characters, such as these words: houses If I tried storing the word “special” in that column, MySQL would chop the value to be “specia”, since the original word has 7 characters. Anyway, integer columns all have a preset range of values allowed. The number in parenthesis only indicates the display width. This is probably still confusing, so let me explain further… The display width is a number from 1 to 255. You can set the display width if you want all of your integer values to “appear” similarly: TINYINT[(M)] [UNSIGNED] [ZEROFILL] M indicates the maximum display width for integer

Categories : Mysql

Java method takes a size parameter, does some work and return a reference and updates the size, reference and size to be used by method 2
If you want to pass numBytes between function calls you have to choice: Using function return value numBytes = 1024; numBytes = numBytes - firstJob(numBytes, ...); secondJob(numBytes,...); or Apache commons-lang Mutable objects MutableInt numBytes = new MutableInt(1024); firstJob(numBytes, ...); secondJob(numBytes, ...); and inside functions you can change integer value inside mutable object without change numBytes reference (you can't do that in Java) Else, if you want to change a BlockInfo or BlockIDSet (passed as parameter) properties you can do without problem. public void firstJob(BlockInfo bi) { bi.blockSize = 23; }

Categories : Java

pdf /F font size size is not real size?
you should also apply Tm text matrix transformations for this value. "A font defines the glyphs for one standard size. This standard is arranged so that the nominal height of tightly spaced lines of text is 1 unit. In the default user coordinate system, this means the standard glyph size is 1 unit in user space, or 1 ⁄ 72 inch. The standard-size font must then be scaled to be usable. The scale factor is specified as the second operand of the Tf operator, thereby setting the text font size parameter in the graphics state."

Categories : Pdf

Setting body { font-size: 100% } results in font-size: 12px; and not font-size: 16px; Why?
If you inspect the inline box using a browser’s Developer Tools (hit F12 to open them), you can see that its height is indeed 12px, as set in your code. This happens because there is nothing in it that would require more height; in general, the exact calculation of heights of inline blocks is browser-dependent. The font size of the text is still the browser default, typically 16px. The font size does not mean the height of any particular letter. It is just a fundamental property of the font; typographers usually design characters so that they - together with ascenders, descenders, and diacritic marks - fit into the limits set by the font size (or extend over them just a little), and normally most letters have smaller height.

Categories : CSS

How do I change the size of a kendo popup edit screen and have all of the items in it resize to the new size?
Can you just use regular CSS? Like: .k-edit-form-container .k-textbox, .k-edit-form-container .k-widget { width: 600px; } You just have to make the selectors be a bit more specific that Kendo's built-in ones.

Categories : Kendo Ui

In MySQL, does the designated size of TEXT or BLOB affect performance or table size?
The difference between BLOB and MEDIUMBLOB is basically that it encodes the length in 2 bytes or 3 bytes. Otherwise, it stores only the length of content you stored on a given row. So you should just declare the column as MEDIUMBLOB. Some client database access libraries (e.g. PHP) will preallocate a buffer to hold the greatest length that the column might return, because they can't tell before fetching whether it's only 65K or 100K or 16MB. I have found that PHP for example blows up if you try to fetch a LONGBLOB, because it preallocates a 4GB buffer, which is greater than the PHP max memory limit.

Categories : Mysql

WPF what determines whether scrollviewer and stackpanel give infinite size to a child as opposed to a set size?
StackPanel measures its children with infinity in the direction of its Orientation, so an infinite height when the Orientation is Vertical; the other orientation is usually given the constraint it got. Canvas always measures its children with an infinite width and height. For a ScrollViewer, if the Content implements IScrollInfo (i.e. it provides the scrolling functionality) and its CanContentScroll is true then the child is measured based on the constraint it is given, possibly minus the amount needed for the scrollbar(s) if they are shown. Of course then it is responsible for handling the scrolling.

Categories : Wpf

Reading a a ReadableStream and specifying a size param: Why does state.highWaterMark always get passed to ._read() as the size?
I think it's wrong to call rs.read(size).pipe(res); This is because according to the docs, rs.read(size) returns a buffer, a string, or null. However, pipe() is a method of Readable. You should probably be using rs.pipe(res); rs.read(size);

Categories : Javascript

dynamically changing the size of font size based on text length using css and html
Getting the size in pixels of a string of text is a hard thing to do and depends a lot on the browser and the user's settings, so it will probably be hard to come up with a solution that works in all cases. By "display user entered text" do you mean the user is typing into a textbox? If so, you can attach a keypress listener that checks the length of the value of the text, then adjusts the font-size accordingly. Here's an example, though you will probably need to change the lengths and font-sizes to meet your needs: Working Demo $('#text').on('keypress', function(e) { var that = $(this), textLength = that.val().length ; if(textLength > 30) { that.css('font-size', '5px'); } else if(textLength > 20) { that.css('font-size', '10px'); } else

Categories : Javascript

change picturebox size , spacing between buttons when user changes window size
You can use Anchor of your controls.Using anchor you can anchor it top ,bottom left right take a look at this Or you can also use Table Layout Panel

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.