dimensions

Shouldn't window.screen.width/height correspond to actual screen width/height?

风流意气都作罢 提交于 2019-11-29 07:43:12
Toying around with the WebKit browser in the new Kindle 3G, I noticed that window.screen.width and window.screen.height don't reflect the actual screen dimensions. The physical screen (or rather, paper) dimensions are 800 x 600 . I get: 800 x 506 in landscape mode 600 x 706 in portrait mode But interestingly, both Chrome and Safari (which are also WebKit) running on my desktop report the actual screen resolution. According to MDC , these properties are not part of any specification, so there's probably no strict definition of what width/height should report. But, shouldn't it be expected that

Getting unknown number of dimensions from a multidimensional array in Java

空扰寡人 提交于 2019-11-29 07:37:35
Is it possible in Java to find the number of dimensions of an array with an 'a priori' unknown number of dimensions? That is, if one doesn't know the number of dimensions of a multidimensional matrix, how could it be retrieved, if possible? Does anyone know if it is possible in Java to get the number of dimensions of an array with an 'a priori' unknown number of dimensions? That is, if one doesn't know the number of dimensions of a multidimensional matrix, how could it be retrieved, if possible? I'm not quiet sure if I understood correctly what you are trying to accomplish. If you just want to

Iphone: Get current view dimensions or screen dimensions

一世执手 提交于 2019-11-28 23:40:50
问题 Hello i want to get the width and height of my main view. I want the correct value in landscape or portrait mode. I've tried the following: NSLog(@"aaa %f", [UIScreen mainScreen].applicationFrame.size.width); NSLog(@"zzz %f", self.view.frame.size.width); These give 300 in landscape and 320 in portrait mode, yes it is larger in portrait mode. So.. my view takes up the whole screen (- status bar) so I expect 480 in landscape mode and 320 in portrait mode. What happened to the rest of the pixels

JComboBox width

别来无恙 提交于 2019-11-28 23:36:06
I have created a jComboBox but it takes the full width of the frame. how to set the width fixed. yes borderlayout for the frame and box layout for the panel. i am adding the code here: import javax.swing.*; import java.awt.BorderLayout; public class Window8 { JFrame frame; JPanel panel; JComboBox combo; public void go(){ String[] option = { "STUDENT", "TEACHER" }; combo.setPreferredSize(new Dimension(1,25)); combo = new JComboBox(option); menu.setSelectedIndex(0); frame = new JFrame("DELETION"); frame.setLocationRelativeTo(null); frame.setSize(400, 300); frame.setDefaultCloseOperation(JFrame

How to get the image dimension from the file name

一世执手 提交于 2019-11-28 22:17:32
I have a file called FPN = "c:\ggs\ggs Access\images\members\1.jpg " I'm trying to get the dimension of image 1.jpg , and I'd like to check whether image dimension is valid or not before loading, and if either width or height of the image is less than or equal to zero, pop up a message like "image not in correct format" Can anyone help me please? System.Drawing.Image img = System.Drawing.Image.FromFile(@"c:\ggs\ggs Access\images\members\1.jpg"); MessageBox.Show("Width: " + img.Width + ", Height: " + img.Height); Wpf class System.Windows.Media.Imaging.BitmapDecoder doesn't read whole file, just

jQuery : add css class to menu item based on browser scroller position

早过忘川 提交于 2019-11-28 22:10:59
I have a menu: <ul class="menu-bottom"> <li id="m1" class="active"><a id="1" href="#"><span>Link 1</span></a></li> <li id="m2"><a id="2" href="#"><span>Link 2</span></a></li> <li id="m3"><a id="3" href="#"><span>Link 3</span></a></li> </ul> I want that depending of browser's scroller position, the "active" class goes the correct < li > element. This is how I see it : if ($(document).height() == 500) { $('#m1').parent().addClass('active'). siblings().removeClass('active'); } if ($(document).height() == 1000) { $('#m2').parent().addClass('active'). siblings().removeClass('active'); } if ($

When should the dimens.xml file be used in Android?

时光怂恿深爱的人放手 提交于 2019-11-28 21:27:07
For instance, in a specific layout I have the following XML: <GridView android:id="@+id/gridView1" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="3dp" android:columnWidth="48dp" android:numColumns="auto_fit" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:stretchMode="spacingWidth" /> This grid view is specific to this layout and I don't think I'll be using any other grid views with similar properties. That to say that the dimension values in the code are specific to that grid view. Should I still move them to a dimens.xml file

Is dp the same as dip? [duplicate]

偶尔善良 提交于 2019-11-28 20:59:08
Possible Duplicate: Difference of px, dp, dip and sp in android I've found several topics on this. But none really answers my question. Dp and dip in android. What is the difference? Is it the same thing? Yes, they are the same. There is no difference, its just an alias. Documentation : The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp". Pratik dp Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will

Is there a simple way to get image dimensions in Ruby?

丶灬走出姿态 提交于 2019-11-28 20:12:33
I'm looking for an easy way to get width and height dimensions for image files in Ruby without having to use ImageMagick or ImageScience (running Snow Leapard). libimage-size is a Ruby library for calculating image sizes for a wide variety of graphical formats. A gem is available, or you can download the source tarball and extract the image_size.rb file. As of June 2012, FastImage which "finds the size or type of an image given its uri by fetching as little as needed" is a good option. It works with local images and those on remote servers. An IRB example from the readme: require 'fastimage'

Get image dimensions [duplicate]

扶醉桌前 提交于 2019-11-28 18:26:17
问题 This question already has an answer here: How can I find the width of an image using PHP? 5 answers I have an url to the image, like $var = http://example.com/image.png How do I get its dimensions to an array , like array([h]=> 200, [w]=>100) (height=200, width=100) ? 回答1: You can use the getimagesize function like this: list($width, $height) = getimagesize('path to image'); echo "width: " . $width . "<br />"; echo "height: " . $height; 回答2: Using getimagesize function, we can also get these