w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
JQuery, How to set background size (height & width)?
This is just simple CSS, not jQuery. You can read more about background-size here: http://www.w3schools.com/cssref/css3_pr_background-size.asp

Categories : Javascript

Equalize height on two floating divs when window size is greater than specified width, then return to original height when window width is below
Working jsFiddle Demo Just remove height from elements: function originalHeight(group) { group.css('height', ''); }

Categories : Jquery

How I can find the page size, page height and width of MS Word Document in Java?
Lets assume you have simple documents (in .docx format) without different layouts per section, then the following will give you the page size (see also this blog entry for the various unit conversions): import org.apache.poi.openxml4j.opc.*; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; public class DocxPageLayout { public static void main(String[] args) throws Exception { OPCPackage opc = OPCPackage.open("example.docx", PackageAccess.READ); XWPFDocument doc = new XWPFDocument(opc); opc.close(); CTSectPr sectPr = doc.getDocument().getBody().getSectPr(); if (sectPr == null) return; CTPageSz pageSize = sectPr.getPgSz(); if (pageSize == null) return; do

Categories : Java

opencv error: assertion failed (size.width>0 && size.height>0) in unknown function line 261
(size.width>0 && size.height>0) means that there is an empty Mat over there. In this case, it must be that image is empty because the camera couldn't be opened. Check VideoCapture::open return value.

Categories : C++

How I can see the width & height of my window on the "body" when I am modifying the size of the window with jquery?
Like that? DEMO http://jsfiddle.net/yeyene/5ANZz/1/ $('#width').val($(window).width()); $('#height').val($(window).height()); $(window).resize(function(){ $('#width').val($(window).width()); $('#height').val($(window).height()); });

Categories : Jquery

Irrlicht change terrain size (width + height)
You can change the scale of the terrain (or any mesh) using setScale. terrain->setScale(vec3df(2.0f, 0.0f, 2.0f)); When you create the terrain, you pass a scale as the 3rd parameter. So calling the line above would result in your terrain being twice as large (stretched) on the X and Z axis as in your snippet. Note that the 0.0f y-value in the scale parameter is going to make your terrain quite flat since it will be used to scale the values supplied in your height map.

Categories : C++

Flexible Font Size for fixed width and height
The general idea is to get overflow:hidden, then keep shrinking the text until the scrollHeight is less than the offsetHeight. Like so: [].forEach.call(document.getElementsByTagName('p'),function(p) { p.style.overflow = "hidden"; var f = 24; while(f > 6 && p.scrollHeight > p.offsetHeight) { f--; p.style.fontSize = f+"px"; } }); Demo

Categories : Javascript

Image size in MB from pixel height and pizel width
Depends on color depth. If you were using 8-bit pixels, it would be: height * width / 1048576 If you were using 32-bit pixels, it would be: 4*height*width/1048576 which is height*width/262144

Categories : C#

How to mention height and Width in terms of percentage in size() in wxpython
You can only specify the size of widgets in wxPython by pixel size. See http://wxpython.org/docs/api/wx.Size-class.html for more information. You cannot pass percentages to it. On the other hand, you can sort of do percentages with widgets inside sizers as sizers support the idea of proportion. But I don't believe that is what you really want.

Categories : Python

Algorithm to calculate values based on width and height (coordinates and size)
What you're describing is what game developers call spritesheets, tilesheets, tilesets, or whatever. The general idea behind all of these is you have one image file of a certain type and inside that image you create subimages which can be pulled out and used individually in your program. Usually in video games these are of a consistent size but they don't have to be. Check out the answer on this link: How to extract part of this image in Java? The answer here explains how to split an image up into several parts. If you can't find what you're looking for there look up how game developers handle spritesheets for example to get an idea of how they do it.

Categories : Java

how to change the size(width/height) of a textarea or a text which is readonly dynamically?
$("#textareaID").width(123);// by this 123 px width set $("#textareaID").height(123);// by this 123 px height set reference height width

Categories : Jquery

Imageresizer: Image URL without width and height query parameter (use original size)
No, at least not with ImageResizer 3.X. ImageResizer doesn't touch requests that don't require processing, and during request inspection there's nothing to indicate that http://host.com/path/to/image/file.jpg.ashx?404=/path/to/image/file.jpg would need any image processing. In fact, just based on the URL, it would be assumed that it's actually a physical .ashx handler taking an arbitrary parameter. ImageResizer tries to play nice with everything else running on your site. You can catch 404s exceptions yourself at the HttpApplication level, however. It's just outside ImageResizer's jurisdiction to do this kind of thing. Another option is to use a no-op command to trigger ImageResizer for the URL, such as &cache=always

Categories : Image

Titanium ImageView can't scale the size by setting the height and width properties?
my origin code is blew, And my purpose is to dynamic get a image from photogallary, and set the img as a backgroundimage of a View whose size is decided by the image: (and I use the https://github.com/6174/TiDraggable module) create-pic-view.bind photo-gallery, -> _this = @ log open-photo-gallery Ti.Media.open-photo-gallery({ success: !(ev)-> log success-get-image-event # inspect ev #image size in pixels img-width = ev.width img-height = ev.height # convertPointToView( Point point, Titanium.UI.View destinationView ) : Point # Translates a point from this view's coordinate system to another view's coordinate system. pic-img = _this.Els.pic-img = draggable.create-view({ background-image: ev.media.n

Categories : Misc

Fixed height and width imageview with large size bitmap issue
Don't used a fixed sample size. Calculate the sample size you need first, like so: public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { // Raw height and width of image final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; if (height > reqHeight || width > reqWidth) { if (width > height) { inSampleSize = Math.round((float)height / (float)reqHeight); } else { inSampleSize = Math.round((float)width / (float)reqWidth); } } return inSampleSize; } Then, use it like so: String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+"/"+photo; final BitmapFactory.Options options = new Bitma

Categories : Android

how to find the layout width and height in xml?
Your layout is a little bit messy , it would better we fix that frist, but to display your listView do something like this: ListView listView = (ListView) findViewById(R.id.clistview); listView.setAdapter(yourAdapter); Take a look in the BaseAdapter another advice don't devine the width and the height manually, because you don't know the size of the device, better use the fill_parent, wrap_content, or use the weigth to control it. I made some changes in your layout, take a look and put your images in the components: code: <LinearLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_marginTop="50dp" android:layout_weight="0.2" android:orientation="horizontal" > <Button android:id="@+id/ckbtn0" andr

Categories : Android

Is there a tool, or script, that can convert CSS Width/Height to the width=""/height="" equivalent on elements?
There are many tools made for this exact use: "inlining" CSS into the body of HTML emails. It does width, height as well as any other properties you have in your CSS declarations. Here are a couple: MailChimp CSS Inliner Tool Campaign Monitor CSS Inliner

Categories : CSS

How can I find the width and height of a specific word within a string?
You'll have to wrap it in its own element or do something more obtuse (generate a new element with just those contents (somewhere offscreen perhaps), calculate the size of that element, and then remove it). You might be able to make a rough calculation based on element line-height and the width of characters (in em units), but without knowing which characters are in use or using a monospace font-family, I can't imagine it will be very accurate.

Categories : Javascript

How to fix the width and height of div and make the content inside div resize to div's width and height?
The content of the iframe is generally unaware of it's "parent" container, thus the sizing of it's contents aren't guaranteed. If you want your iframe's content to be resized...this can only be accomplished through javascript if it's in the same domain. Or if its a different domain, the url would require parameters/logic and resize the content through javascript based on those parameters.

Categories : Jquery

How to find exact NSString size height?
You have to ask UIFont UIFont *font = [UIFont fontWithName:@"HelveticaNeue" size:13.0]; NSLog(@"Capital Letter Height: %f", font.capHeight); NSLog(@"X Height: %f", font.xHeight); NSLog(@"Lower Letter Height: %f", font.xHeight - font.descender);

Categories : Objective C

Can't set width, height of