size

How to change size and image in TabControl

自作多情 提交于 2019-12-01 22:14:27
I want to change size of TabPage in my TabControl , each tab should be in one line without scroll. the second question is about how to change Text into Image like here (Please, ignore the green line): edit. I used Winforms. Ad 1. There is no way to adjust width of tab pages to fit width you want automatically, so you just have to do some maths to achieve this. Ad 2. First you have to create an ImageList object, which you will then pass to your TabControl : ImageList il = new ImageList(); il.Images.Add("your_graphics_name", Image.FromFile(@"C:\Graphics\example.png")); (...) yourTabControl

How to change size and image in TabControl

别等时光非礼了梦想. 提交于 2019-12-01 21:49:36
问题 I want to change size of TabPage in my TabControl , each tab should be in one line without scroll. the second question is about how to change Text into Image like here (Please, ignore the green line): edit. I used Winforms. 回答1: Ad 1. There is no way to adjust width of tab pages to fit width you want automatically, so you just have to do some maths to achieve this. Ad 2. First you have to create an ImageList object, which you will then pass to your TabControl : ImageList il = new ImageList();

Screen Size Honeycomb Menu android

廉价感情. 提交于 2019-12-01 21:43:54
Hi I am trying yo get the screen size of screen minus the menu bar at the bottom. I know I could just subtract a constant number according to the resolution of the device but it is a super ugly hack. I am sure google people are not dumb enough to forget to give the user a function to get the height of the bottom menu bar so I can subtract it from the full screen size This is a similar post. Size of android notification bar and title bar? DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); what_i_need =metrics.heightPixels-buttomMenuHeight(

Size of array after a deallocate

≡放荡痞女 提交于 2019-12-01 21:28:55
问题 I have created an allocatable array. I allocate the elements and then I print the size of the array. I find strange that the size remains the same after a deallocate. Integer, Allocatable :: fred(:) Allocate (fred(3)) Write (*,*) "fred: ", Size (fred) Deallocate (fred) Write (*,*) "fred: ", Size (fred) 回答1: This is a question crying out for a canonical one, really. In the interest of answering your specific question in the absence (as far as I can tell, but I may write one eventually), I'll

Reduce pyinstaller executable size

余生颓废 提交于 2019-12-01 21:23:42
问题 I have only one line of code input() written in python and packed with pyinstaller with option --onefile . The exe file is 4577 kB which is almost 5Mb. How can I reduce its size or exclude some auto-bundled libraries? 回答1: The .exe file you create using pyinstaller includes the python interpreter and all modules included in your script.Maybe, the modules you are using have a big library themselves. You can however try using py2exe but it might not work for all projects.The other way to get it

C++ explicit关键字详解

大兔子大兔子 提交于 2019-12-01 21:12:30
首先, C++中的explicit关键字只能用于修饰只有一个参数的类构造函数, 它的作用是表明该构造函数是显示的, 而非隐式的, 跟它相对应的另一个关键字是implicit, 意思是隐藏的,类构造函数默认情况下即声明为implicit(隐式). 那么显示声明的构造函数和隐式声明的有什么区别呢? 我们来看下面的例子: class CxString // 没有使用explicit关键字的类声明, 即默认为隐式声明 { public: char *_pstr; int _size; CxString(int size) { _size = size; // string的预设大小 _pstr = malloc(size + 1); // 分配string的内存 memset(_pstr, 0, size + 1); } CxString(const char *p) { int size = strlen(p); _pstr = malloc(size + 1); // 分配string的内存 strcpy(_pstr, p); // 复制字符串 _size = strlen(_pstr); } // 析构函数这里不讨论, 省略... }; // 下面是调用: CxString string1(24); // 这样是OK的, 为CxString预分配24字节的大小的内存 CxString

iOS UIView get frame after rotation

社会主义新天地 提交于 2019-12-01 21:10:58
I'm trying to get the size of my UIView after the orientation changes. In my view controller I implement didRotateFromInterfaceOrientation: and call setNeedsLayout: on my view. In my view's layoutSubviews method, it tries to perform some logic based on its new frame size post rotation, but the frame size has not been updated to reflect the new orientation (e.g. it is still 768x1024 instead of 1024x768 after moving to landscape). How do I get the updated frame size? Just going to answer with what Luis Oscar said so that the question shows up as answered. The solution is to access the "bounds"

Reduce pyinstaller executable size

孤人 提交于 2019-12-01 21:05:16
I have only one line of code input() written in python and packed with pyinstaller with option --onefile . The exe file is 4577 kB which is almost 5Mb. How can I reduce its size or exclude some auto-bundled libraries? The .exe file you create using pyinstaller includes the python interpreter and all modules included in your script.Maybe, the modules you are using have a big library themselves. You can however try using py2exe but it might not work for all projects.The other way to get it smaller is to use a compression program as like, compress the executable using UPX (have a look at this:

Size of array after a deallocate

若如初见. 提交于 2019-12-01 21:01:30
I have created an allocatable array. I allocate the elements and then I print the size of the array. I find strange that the size remains the same after a deallocate. Integer, Allocatable :: fred(:) Allocate (fred(3)) Write (*,*) "fred: ", Size (fred) Deallocate (fred) Write (*,*) "fred: ", Size (fred) This is a question crying out for a canonical one, really. In the interest of answering your specific question in the absence (as far as I can tell, but I may write one eventually), I'll answer. The argument to size must not be an unallocated allocatable variable. For your code fred is an

Why setPreferredSize does not change the size of the button?

此生再无相见时 提交于 2019-12-01 20:57:41
Here is the code: import javax.swing.*; import java.awt.event.*; import java.awt.*; public class TestGrid { public static void main(String[] args) { JFrame frame = new JFrame("Colored Trails"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(4, 9)); panel.setMaximumSize(new Dimension(9*30-20,4*30)); JButton btn; for (int i=1; i<=4; i++) { for (int j=1; j<=4; j++) { btn = new JButton(); btn.setPreferredSize(new Dimension(30, 30));