Search Results

Search found 17944 results on 718 pages for 'size t'.

Page 4/718 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Create thumbnail and reduce image size

    - by oo
    I have very large images (jpg) and i want to write a csharp program to loop through the files and reduce the size of each image by 75%. I tried this: Image thumbNail = image.GetThumbnailImage(800, 600, null, new IntPtr()); but the file size is still very large. Is there anyway to create thumbnails and have the filesize be much smaller?

    Read the article

  • How to check total cache size using a program

    - by user1888541
    so I'm having some trouble creating a program to measure cache size in C. I understand the basic concept of going about this but I'm still having trouble figuring out exactly what I am doing wrong. Basically, I create an array of varying length (going by power of 2s) and access each element in the array and put it in a dummy variable. I go through the array and do this around 1000 times to negate the "noise" that would otherwise occur if I only did it once to get an accurate measurement for time. Then, I look for the size that causes a big jump in access time. Unfortunately, this is where I am having my problem, I don't see this jump using my code and clearly I am doing something wrong. Another thing is that I used /proc/cpuinfo to check the cache and it said the size was 6114 but that was not a power of 2. I was told to go by powers of 2 to figure out the cache can anyone explain why this is? Here is the just of my code...I will post the rest if need be { struct timeval start; struct timeval end; // int n = 1; // change this to test different sizes int array_size = 1048576*n; // I'm trying to check the time "manually" first before creating a loop for the program to do it by itself this is why I have a separate "n" variable to increase the size char x = 0; int i =0, j=0; char *a; a =malloc(sizeof(char) * (array_size)); gettimeofday(&start,NULL); for(i=0; i<1000; i++) { for(j=0; j < array_size; j += 1) { x = a[j]; } } gettimeofday(&end,NULL); int timeTaken = (end.tv_sec * 1000000 + end.tv_usec) - (start.tv_sec *1000000 + start.tv_usec); printf("Time Taken: %d \n", timeTaken); printf("Average: %f \n", (double)timeTaken/((double)array_size); }

    Read the article

  • How to set the size of multiple buttons on content

    - by rob
    I am using three buttons along with the list view.These three buttons are added to the layout using the TableLayout and TableRow.The first button takes more space on content, so the other two becomes smaller in size than first one. When the application runs, it doesn't even show the two other buttons. How can I make the size of three buttons equal and display all of them when application runs?Give me some example please. Thanks

    Read the article

  • C# File IO with Streams - Best Memory Buffer Size

    - by AJ
    Hi, I am writing a small IO library to assist with a larger (hobby) project. A part of this library performs various functions on a file, which is read / written via the FileStream object. On each StreamReader.Read(...) pass, I fire off an event which will be used in the main app to display progress information. The processing that goes on in the loop is vaired, but is not too time consuming (it could just be a simple file copy, for example, or may involve encryption...). My main question is: What is the best memory buffer size to use? Thinking about physical disk layouts, I could pick 2k, which would cover a CD sector size and is a nice multiple of a 512 byte hard disk sector. Higher up the abstraction tree, you could go for a larger buffer which could read an entire FAT cluster at a time. I realise with today's PC's, I could go for a more memory hungry option (a couple of MiB, for example), but then I increase the time between UI updates and the user perceives a less responsive app. As an aside, I'm eventually hoping to provide a similar interface to files hosted on FTP / HTTP servers (over a local network / fastish DSL). What would be the best memory buffer size for those (again, a "best-case" tradeoff between perceived responsiveness vs. performance). Thanks in advance for any ideas, Adam

    Read the article

  • How to determine the size of a project (lines of code, function points, other)

    - by sixtyfootersdude
    How would you evaluate project size? Part A: Before you start a project. Part B: For a complete project. I am interested in comparing unrelated projects. Here are some options: 1) Lines of code. I know that this is not a good metric of productivity but is this a reasonable measure of project size? If I wanted to estimate how long it would take to recreate a project would this be a reasonable way to do it? How many lines of code should I estimate a day? 2) Function Points. Functions points are defined as the number of: inputs outputs inquires internal files external interfaces Anyone have a veiw point on whether this is a good measure? Is there a way to **actually do this? Does anyone have another solution? Hours taken seems like it could be a useful metric but not solely. If I ask you what is a "bigger program" and give you two programs how would you approach the question? I have seen several discussions of this on stackover flow but most discuss how to measure programmer productivity. I am more interested in project size.

    Read the article

  • File IO with Streams - Best Memory Buffer Size

    - by AJ
    I am writing a small IO library to assist with a larger (hobby) project. A part of this library performs various functions on a file, which is read / written via the FileStream object. On each StreamReader.Read(...) pass, I fire off an event which will be used in the main app to display progress information. The processing that goes on in the loop is vaired, but is not too time consuming (it could just be a simple file copy, for example, or may involve encryption...). My main question is: What is the best memory buffer size to use? Thinking about physical disk layouts, I could pick 2k, which would cover a CD sector size and is a nice multiple of a 512 byte hard disk sector. Higher up the abstraction tree, you could go for a larger buffer which could read an entire FAT cluster at a time. I realise with today's PC's, I could go for a more memory hungry option (a couple of MiB, for example), but then I increase the time between UI updates and the user perceives a less responsive app. As an aside, I'm eventually hoping to provide a similar interface to files hosted on FTP / HTTP servers (over a local network / fastish DSL). What would be the best memory buffer size for those (again, a "best-case" tradeoff between perceived responsiveness vs. performance).

    Read the article

  • ntfsresize volume and size information

    - by antonio
    I am going to resize my sda2 NTFS partition. When gathering info with ntfsresize, I get: ntfsresize --info /dev/sda2 ntfsresize v2013.1.13 (libntfs-3g) Device name : /dev/sda2 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 21999993344 bytes (22000 MB) Current device size: 23622320128 bytes (23623 MB) Checking filesystem consistency ... Accounting clusters ... Space in use : 10673 MB (48.5%) Collecting resizing constraints ... You might resize at 10672590848 bytes or 10673 MB (freeing 11327 MB). Please make a test run using both the -n and -s options before real resizing! Can you tell me what is the difference between volume and device size? As for device size, 23622320128 bytes / 1000^2 = 23622.3 MB. Why is 23623 MB reported instead of 23622? Note that parted confirms this value: parted /dev/sda2 unit MB p Model: Unknown (unknown) Disk /dev/sda2: 23622MB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File system Flags 1 0.00MB 23622MB 23622MB ntfs

    Read the article

  • Set page size using WIA (with scanner)

    - by Salvador Sarpi
    Hello, I'm using WIA to acquire images from a scanner with C#. I can scan the papers, but I can't set up the page size correctly, it always defaults to A4 and I need to use Letter or Legal sometimes. I tried with the WIA_DPS_PAGE_SIZE property, but when I try to set a value, I always get an error, that the value is out of the interval (tried a lot of possible values). I wan't to be able to use WIA_DPS_PAGE_SIZE = WIA_PAGE_AUTO (for automatic page size), but I can't find anything on the web related to this. Does anyone know a solution? thanks!

    Read the article

  • UIImageView size becomes equal to the size of image it holds after autoresizing

    - by abura
    Hello, I faced a strange problem. My task is to provide scaling an image to fill the UIImageView frame. The UIImageView is a subview of another view. The code is following: CGRect frame=CGRectMake(0,0,viewSize.width,viewSize.height); UIView* backView=[[UIView alloc] initWithFrame:frame]; backView.autoresizesSubviews=YES; backView.autoresizingMask=UIViewAutoresizingFlexibleWidth; UIImageView* imgView=[[UIImageView alloc]initWithFrame:viewFrame]; imgView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; imgView.contentMode=UIViewContentModeScaleToFill; [subcellBackView addSubview:imgView]; [imgView release]; When the image arrives, it is assigned the the imgView: imgView.image=img; The image is scaled according to the imgView's size. Everything is all right until the iPhone (simulator) rotation. After first autoresizing the imgView size becomes equal to the image size (which is much greater) and overlaps its superview frame. The superview frame reacts properly to the orientation change. Could you please help?

    Read the article

  • CSS size transition to stay inside parent div

    - by IlyaD
    I want to have an image frame that when I hove over it the image inside will zoom in a little (I am using size transition), but the frame will stay the same size. What happens now that even if the frame has a fixed width and height it is stilled zoomed with the image HTML: <div class="img-wrapper"> <img class="thumbnail" src="http://placekitten.com/400/200"> </div> and CSS .img-wrapper { width: 400px; } .thumbnail { width: 400px; } .thumbnail { -webkit-transition: all 0.2s ease-out; -moz-transition: all 0.2s ease-out; transition: all 0.2s ease-out; } .thumbnail:hover { width: 500px; -webkit-transition: all 0.2s ease-out; -moz-transition: all 0.2s ease-out; transition: all 0.2s ease-out; } http://codepen.io/pen/KCJny

    Read the article

  • XHR FF POST size limit

    - by usurper
    Hi, My XHR POST REQUEST is cut off. When I try to reload my page information is missing. Firebugs sends following message: ... Firebug request size limit has been reached by Firebug. ... My question is: What are my options? Would it work if I declare the content.length in the header? I added a line to my apache config file and restarted it: LimitRequestBody 0 I increased the size of transfer files in mysql config file Or it is a browser issue? The only solution I could think of was to cut the data in pieces and transmit the array one by one but I don't like this idea. The content length is 91691 according to firebug. Any suggestions?

    Read the article

  • ajax response byte size

    - by Alex Pacurar
    Im using jQuery's getJSONP and I want to log the duration of the call and the size of the response to be able to have some statistics about the usage of my application. This is a cross domain ajax call, so I need to use JSONP, but as the JSONP call is not done with an XMLHttpRequest object, the complete callback from jquery's ajax doesnt pass the response content. So my question is how to get the response size (content lenght) from a JSONP call. $.ajaxSetup( { complete:function(x,e) { log(x.responseText.length, x.responseText); } } here x is a XMLHttpRequest object for a JSON call , but for JSONP call is undefined.

    Read the article

  • Size and position of the C# form.

    - by Vytas999
    I use Visual Studio .NET to create a Windows-based application. The application includes a form named CForm. CForm contains 15 controls that enable users to set basic configuration options for the application. I design these controls to dynamically adjust when users resize CForm. The controls automatically update their size and position on the form as the form is resized. The initial size of the form should be 650 x 700 pixels. If CForm is resized to be smaller then 500 x 600 pixels, the controls will not be displayed correctly. How I must ensure that users cannot resize CForm to be smaller than 500 x 600 pixels..?

    Read the article

  • How to change font size in a pickerview?

    - by user183804
    I'm fairly new to iPhone programming and am trying to implement a double-component PickerView. At this point the picker works fine in terms of taking user input, created with Interface Builder. However, I need to change the font size to accommodate the text length in each column. I very much would appreciate any link to a straightforward method to creating a multi-component picker with an adjustable font size. Seems like it is not possible if Interface Builder is used to create the picker. So far I have not found any code links that address this issue in detail. Thanks in advance.

    Read the article

  • Change the size of the panel dynamically

    - by C. Karunarathne
    Hi! I am implementing an application that needs to drag and drop image boxes in a panel.Image boxes are added dynamically from the program and so I have set the autoscroll property to true in panel.But when I have drag out the boxes at bottom in the panel the panel size got reduced.I have put autosize property false in panel.The panel is docked in another panel.I want to set the size of panel at run time.How can I achieve this. public form1(int[,] dummy, int columnSize, int rowSize) { this.dummy= dummy; numOfColumns = columnSize; numOfRows = rowSize; getData(); addIds = addIdArray; data = mylist; InitializeComponent(); //panel1.MinimumSize = new Size(columnSize * 40, rowSize * 40); //panel1.Height = rowSize * 40; //panel1.Width = columnSize * 40; //panel4.Height = rowSize * 40; //panel4.Width = columnSize * 40; int x, y; Structures.EmptyRectSpace space = new Structures.EmptyRectSpace(); for (int i = 0; i < data.Count; i++)// set picture boxes { space = (Structures.EmptyRectSpace)data[i]; x = space.startingJ; y = space.startingI; int h, w; h = space.length; w = space.width; p = new PictureBox(); p.Width = w * 40; p.Height = h * 40; p.BackColor = Color.DarkGreen; p.Image = Properties.Resources.v; p.BorderStyle = BorderStyle.FixedSingle; p.Name = addIdArray[i].ToString(); p.Location = new Point((x + 1 - w) * 40, (y + 1 - h) * 40); this.panel1.Controls.Add(p); } foreach (Control c in this.panel1.Controls) { if (c is PictureBox) { c.MouseDown += new MouseEventHandler(pictureBox1_MouseDown); } } this.panel1.DragOver += new System.Windows.Forms.DragEventHandler(this.panel1_DragOver); panel1.DragOver += new DragEventHandler(panel1_DragOver); panel1.DragDrop += new DragEventHandler(panel1_DragDrop); panel1.AllowDrop = true; panel2.AllowDrop = true; foreach (Control c in this.panel2.Controls) { c.MouseDown += new MouseEventHandler(pictureBox1_MouseDown); } this.panel2.DragOver += new System.Windows.Forms.DragEventHandler(this.panel2_DragOver); panel2.DragOver += new DragEventHandler(panel2_DragOver); panel2.DragDrop += new DragEventHandler(panel2_DragDrop); } This is the constructor of the form that contained panel.When it loaded the picture boxes must be added to the panel and there drag drop events of panel are implemented. Please give me a helping hand..

    Read the article

  • Get dimensions for dataset matlab, Size Function

    - by Tim
    Hello I have been trying to display the dimensions of a dataset, below is the following matlab code that i used...but it gives me the wrong output....i'e number of rows and columns values are wrong....any help regarding this issue would be highly appreciated [file_input,pathname] = uigetfile( ... {'*.txt', 'Text (*.txt)'; ... '*.xls', 'Excel (*.xls)'; ... '*.*', 'All Files (*.*)'}, ... 'Select files'); [pathstr, name, ext, versn] = fileparts(file_input) r = size(name,1); c = size(name,2); disp(r) disp(c)

    Read the article

  • Set UIImageView Size?

    - by Tronic
    hi, i have following problem: i generate subviews UIView in an UIScrollView including UIImageViews. NSArray *bilder = [[NSArray alloc] initWithObjects:@"lol.jpg", @"lol2.jpg", nil]; NSArray *added = [[NSMutableArray alloc] init]; UIImageView *tmpView; for (NSString *name in bilder) { UIImage *image = [UIImage imageNamed:name]; tmpView = [[UIImageView alloc] initWithImage:image]; tmpView.contentMode = UIViewContentModeScaleAspectFit; tmpView.frame = CGRectMake(0, 0, 300, 300); [added addObject:tmpView]; [tmpView release]; } CGSize framy = mainFrame.frame.size; NSUInteger x = 0; for (UIView *view in added) { [mainFrame addSubview:view]; view.frame = CGRectMake(framy.height * x++, 0, framy.height, framy.width); } mainFrame.scrollEnabled = YES; mainFrame.pagingEnabled = YES; mainFrame.contentSize = CGSizeMake(framy.height * [added count], framy.width); mainFrame.backgroundColor = [UIColor blackColor]; i get image file names out of an array. now i want to resize the imageview to a specific size, but it won't work. any advice? thanks + regards

    Read the article

  • matlab: figure size, same axis size

    - by Art
    I have a figure with fixed size, like that: hFig = figure(1); set(hFig, 'Position', [200 200 500 500]) But the thing is, that I want to have my AXIS with fixed size (i want them to be a square), not (necessary) the whole figure... - see image attached, Y axis is a bit longer than X axis (of course longer in a meaning of display... X and Y axis range is set to the same value). How to adjust it? Thanks!

    Read the article

  • Image processing on bifurcation diagram to get small eps size

    - by yCalleecharan
    Hello, I'm producing bifurcation diagrams (which are normally used in nonlinear dynamics). These diagrams identify abrupt changes in topologies due to stability changes. These abrupt changes occur as one or more parameters pass through some critical value(s). An example is here: http://en.wikipedia.org/wiki/File:LogisticMap_BifurcationDiagram.png On the above figure, some image processing has been done so as to make the plot more visually pleasant. A bifurcation diagram usually contains hundreds of thousands of points and the resulting eps file can become very big. Journal submission in the LaTeX format require that figures are to be submitted in the eps format. In my case one of such figures can result in about 6 MB in Matlab and even much more in Gnuplot. For the example in the above figure, 100,000 x values are calculated for each r and one can imagine that the resulting eps file would be huge. The site however explains some image processing that makes the plot more visually pleasing. Can anyone explain to me stepwise how go about? I can't understand the explanation provided in the "summary" section. Will the resulting image processing also reduce the figure size? Furthermore, any tips on reducing the file size of such a huge eps figure? Thanks a lot...

    Read the article

  • how to fix error in bitmap size exceeds VM budget

    - by narasimha
    hi folks i am working one application image uploading to sdcard i am scaling that sdcard saved into database some times one error is occurs bitmap size exceeds vm budget ouput : 01-11 15:39:51.809: ERROR/AndroidRuntime(6214): Uncaught handler: thread main exiting due to uncaught exception 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:384) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:397) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.fitzgeraldsoftware.shout.presentationLayer.Shout.onActivityResult(Shout.java:1653) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.Activity.dispatchActivityResult(Activity.java:3624) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.deliverResults(ActivityThread.java:3220) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.access$2600(ActivityThread.java:116) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.os.Handler.dispatchMessage(Handler.java:99) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.os.Looper.loop(Looper.java:123) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at java.lang.reflect.Method.invokeNative(Native Method) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at java.lang.reflect.Method.invoke(Method.java:521) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at dalvik.system.NativeStart.main(Native Method) how can fix the error please forward some solution thanks in advance

    Read the article

  • How to change size of Android ScrollView

    - by user611923
    I have a layout like this (abstracted): Scrollview - fill_parent LinearLayout - wrap_content ImageView 1 - wrap_content ImageView 2 - ... ImageView 3 ... In the course of user interaction some images are replaced by larger or smaller ones, shortening or lenghtening the area to be scrolled. And that is the problem. The Scrollview (SV) does not know about the change, so either it scrolls over a lot of empty space at the bottom, or cuts off a picture or two at the bottom. Question 1: Can I somehow make the SV readapt to the changed hight of the LiearLayout (LL)? Question 2: I can obtain the current size through getHight on the LL. But supplyong it to the SV via changed LayoutParams does not work - of course, that would only change the height of the SV on the screen. Is there a way to put the changed height of the LL into the SV in the code, somehow? Question 3: I havn't tried it yet. Would creating the SV, LL and its children in code and then adding/removing children of changed size as required, make the SV adapt to the changes? And last question: Is there a better aüpproach, except using ListViews?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >