size

VC++: How to get the time and date of a file?

我的梦境 提交于 2020-01-02 07:43:13
问题 How do I get the file size and date stamp of a file on Windows in C++, given its path? 回答1: You can use FindFirstFile() to get them both at once, without having to open it (which is required by GetFileSize() and GetInformationByHandle() ). It's a bit laborious, however, so a little wrapper is helpful bool get_file_information(LPCTSTR path, WIN32_FIND_DATA* data) { HANDLE h = FindFirstFile(path, &data); if(INVALID_HANDLE_VALUE != h) { return false; } else { FindClose(h); return true; } } Then

delphi - calculate directory size API?

佐手、 提交于 2020-01-02 07:14:28
问题 Anyone knows other way to get a directoy's size, than calculate it's size by counting file with file? I'm interested on some win32 API function. I've google it about this, but i didn't found relevant information so i'm asking here. PS: I know how to calculate a directory size by using findfirst and findnext and sum all file's size. 回答1: Getting the size of one directory is a pretty big problem, mostly because it's something you can't define. Examples of problems: Some filesystems, including

delphi - calculate directory size API?

最后都变了- 提交于 2020-01-02 07:13:03
问题 Anyone knows other way to get a directoy's size, than calculate it's size by counting file with file? I'm interested on some win32 API function. I've google it about this, but i didn't found relevant information so i'm asking here. PS: I know how to calculate a directory size by using findfirst and findnext and sum all file's size. 回答1: Getting the size of one directory is a pretty big problem, mostly because it's something you can't define. Examples of problems: Some filesystems, including

Changing font size in Java

旧街凉风 提交于 2020-01-02 05:37:15
问题 I got my own custom font working in Java, but I have one problem, the font size seems to be staying at 1. I tried font.deriveFont(20.0f); at my initialize method, but, it didn't resize. try { font = Font.createFont(Font.TRUETYPE_FONT, new File("D:/StanJump/mailrays.ttf")); font.deriveFont(20.0f); } catch (Exception ex) {} This is my code to create the font and try to change the size, but this didn't work. Any help on making it work, please? 回答1: deriveFont returns a reference to a new font

setSize not influencing size of button

送分小仙女□ 提交于 2020-01-02 04:42:27
问题 I have a sample code : import java.awt.*; import javax.swing.*; import javax.swing.border.BevelBorder; public class AWT extends JFrame { public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setPreferredSize(new Dimension(600, 450)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setBackground(Color.green.darker()); Button btn_1 = new Button("Button 1"); btn_1.setBackground(Color.green.darker()); btn_1.setSize(40, 100); Button btn_2 = new Button(

Get size of Bitmap Android [duplicate]

亡梦爱人 提交于 2020-01-02 01:03:23
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Bitmap byte-size after decoding? Is there anyway so I can get the size of this Bitmap?I've tried to use getByteCount() but I can't use it? Bitmap bitmap = BitmapFactory.decodeByteArray(decryptedData , 0, decryptedData .length); //decoding bytearrayoutputstream to bitmap Any suggestions? 回答1: As you can see from the API, you can use getWidth() getHeight() for the size of the Bitmap in pixels. And if it is an

CSS: Max-Width won't shrink? [duplicate]

落爺英雄遲暮 提交于 2020-01-02 00:50:31
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Make CSS Div Width Equal To Contents I am trying to make a chat like application but now I ran acros a little bug of some sort. I have a div with a max-width set to 350px. But when I put the following text in it: dddddddddddd ddddddddddd dddddddddd dddddddddd It will add new lines at every space but the width of the div will stay at 100px. I made a little example in jsFiddle here: http://jsfiddle.net/5t2hm/12/

CSS: Max-Width won't shrink? [duplicate]

给你一囗甜甜゛ 提交于 2020-01-02 00:50:15
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Make CSS Div Width Equal To Contents I am trying to make a chat like application but now I ran acros a little bug of some sort. I have a div with a max-width set to 350px. But when I put the following text in it: dddddddddddd ddddddddddd dddddddddd dddddddddd It will add new lines at every space but the width of the div will stay at 100px. I made a little example in jsFiddle here: http://jsfiddle.net/5t2hm/12/

Get image size when it loads from an extern URL in Javascript

时光总嘲笑我的痴心妄想 提交于 2020-01-01 20:58:21
问题 I need to know the image size when it loads from an extern URL because the project needs to resize the image div. I need to do something like this: <img id="imglegend'+layername+'" src="url_to_an_extern_host" /> And, using Javascript and JQuery: $('#imglegend'+layername).ready(function(){ var h = $('#imglegend'+layername); // Resize image div container }); But this didn't work. Is it possible to do? Thanks in advance! 回答1: $('#imglegend').load(function(){ var w = $(this).width(); var h = $

Gnuplot multiplot with one colorbox

雨燕双飞 提交于 2020-01-01 19:42:16
问题 I have a layout of 3,1 plots using multiplot. All of the three plots have the same scales, so I just want to show one colorbox, on the right margin. However, once I unset the colorbox for the first two plot, the size of the three plot are different. Can anybody tell me how to implement this with the three plots have the same size? 回答1: You must set a fixed right margin with e.g. set rmargin at screen 0.85 . That sets the right border of the plot at 85% of the image size: set multiplot layout