size

How can I set the width of radio buttons to change with regards to screen size? (android)

泪湿孤枕 提交于 2019-11-28 01:29:12
I have these radio buttons and they need android:width="X" and android:height"X" however, I do not know how to set these properties so that they adapt to a different screen size. Here is the code I'm using for my buttons: <RadioGroup android:layout_width="fill_parent" android:layout_height="50px" android:orientation="horizontal" android:checkedButton="@+id/first" android:id="@+id/states"> <RadioButton android:id="@+id/first" android:background="@drawable/button_radio" android:width="50px" android:height="50px" /> <RadioButton android:id="@+id/second" android:background="@drawable/button_radio"

how can i put a JButton on an image?

核能气质少年 提交于 2019-11-28 01:05:00
问题 I am trying to fix a JFrame where there will be a background image and on the image JButtons which will do some commands. I try to do it without layout because i want to put small buttons in some specific locations on the JFrame but every time i do it, the background image comes to the front or the JFrame has size equal to the JFrame size. With the following code, the JButton has the same size to JFrame. I have tried to change the size and location of the JButton but nothing. Can you help me

Python Tkinter: Attempt to get widget size

北慕城南 提交于 2019-11-28 00:54:23
I am trying to find the size of my window by using the winfo_geometry() function but it ends up returning 1x1+0+0 I have also tried winfo_height, winfo_width but i keep getting 1 CODE from tkinter import * root=Tk() root.geometry('400x600') print (root.winfo_width()) print (root.winfo_height()) print (root.winfo_geometry()) root.mainloop() You are trying to get the dimensions before the window has been rendered. Add a root.update() before the print s and it shows the correct dimensions. from Tkinter import * root=Tk() root.geometry('400x600') root.update() print (root.winfo_width()) print

What's the maximum size of a numpy array?

此生再无相见时 提交于 2019-11-27 22:44:36
I'm trying to create a matrix containing 2 708 000 000 elements. When I try to create a numpy array of this size it gives me a value error. Is there any way I can increase the maximum array size? a=np.arange(2708000000) ValueError Traceback (most recent call last) ValueError: Maximum allowed size exceeded You're trying to create an array with 2.7 billion entries. If you're running 64-bit numpy, at 8 bytes per entry, that would be 20 GB in all. So almost certainly you just ran out of memory on your machine. There is no general maximum array size in numpy. A ValueError indicates the size is too

Size of zero pixels in CSS with or without 'px' suffix? [duplicate]

可紊 提交于 2019-11-27 21:54:23
This question already has an answer here: 'property: 0' or 'property: 0px' in CSS? 9 answers Googling for the answer to this question has proven difficult so I figured somebody here should know. Within CSS, I've seen zero pixels declared as simply '0' yet also as '0px'. mystyle { width: 0; } anotherstyle { width: 0px; } The minor problem with '0' is that if you change it to some non-zero value, you might forget to add the 'px'. And when making a value '0', you may forget to remove the 'px'. I want pure consistency in my code and little things like this drive me nuts. Does this really come down

JAVA自己实现List接口Stack

﹥>﹥吖頭↗ 提交于 2019-11-27 21:49:14
package 集合.Stack; import java.util.Arrays; import java.util.EmptyStackException; import java.util.Vector; public class MyStack { //底层数组默认长度为10 private Object[] myStack = new Object[10]; //size private int size = 0; public MyStack() { } //push public Object push(Object obj) { //先判断是否需要扩容 if(size>=myStack.length){ myStack = Arrays.copyOf(myStack,myStack.length*2); } //添加元素 myStack[size++] = obj; //size++; return obj; } //pop弹出栈顶元素 public Object pop() { Object obj = peek(); //忽略栈顶元素 size--; return obj; } //peek查找栈顶元素 public Object peek() { if(empty()){ throw new EmptyStackException(); } return

How can I set size of a button?

ⅰ亾dé卋堺 提交于 2019-11-27 21:07:16
I put my buttons in a JPane with GridLayout. Then I put JPanel into another JPanel with BoxLayout.Y_AXIS. I want buttons in the GridLayout to be square. I use tmp.setSize(30,30) and it does not work. I also try to use new GridLayout(X, Y, 4, 4) but I cannot figure out what X and Y are. So, what is the correct way to do this stuff? ADDED: I still cannot solve the problem. Here is the code of what I am trying to do: import javax.swing.*; import java.awt.*; public class PanelModel { public static void main(String[] args) { JFrame frame = new JFrame("Colored Trails"); frame

How to know the size of a variable in MATLAB

与世无争的帅哥 提交于 2019-11-27 20:26:08
I have variables in MATLAB, I've checked their class using class() but I also want to know the size that they take in the memory. More accurately, I know that they are of double type, and I want to make sure that they are 32-bit double and not 64-bit. The version of the MATLAB I'm using is R2009b. You can use whos to obtain an array of structures that describe, amongst other things, the size in bytes of each variable. Note that a double is, by definition, 64-bit! I wrote a simple convenience function to handle just this problem. Usage is: >> x = ones(1000); >> ByteSize(x) 7.63 Mb I run R2007a,

Android: Canvas.drawText() text size on different screen resolutions

坚强是说给别人听的谎言 提交于 2019-11-27 20:16:43
问题 For my Android game I have some calls to Canvas.drawText() . For testing, I use the standard font size which seems to be working fine. However, when I bump up the resolution to a higher density, the larger images are automatically loaded but the text is now incredibly small. Is there an easy way to calculate what size the text should be drawn at or am I bound to do this manually? edit: What was the point of editing my post @Suragch ? 回答1: The easiest way is to define your font sizes in your

Resize text size of a label when the text got longer than the label size?

寵の児 提交于 2019-11-27 20:07:01
I have a label that shows the file name .. I had to set AutoSize of the label to False for designing. So when the file name text got longer than label size.. it got cut like in the picture. label1.Size = new Size(200, 32); label1.AutoSize = false; How do I re-size the text automatically to fit the label size, when the text is longer than the label size? bnguyen82 You can use my code snippet below. System needs some loops to calculate the label's font based on text size. while(label1.Width < System.Windows.Forms.TextRenderer.MeasureText(label1.Text, new Font(label1.Font.FontFamily, label1.Font