Attempting to clone part of an image causes the OutOfMemoryException to be thrown.  The line that causes the error is:  TileImage = TileFileImage.Clone(CloneRect, TileFileImage.PixelFormat);   TileFileImage is 271x271px in size.  CloneRect's upper left corner is at (186, 16) and its lower right corner is at (202, 32) before the exception is thrown.  Both TileImage and TileFileImage are Bitmaps.  CloneRect can never be larger than 271x271px.  Logic in the method the above statement is in prevents the rectangle from exceeding the bounds of the image.  How do I fix this?  UPDATE:  I checked over my logic and found the problem.  Some indices could end up outside the source Bitmap.
95490
Why am I getting an out of memory exception?  So this dies in C# on the first time through:  splitBitmaps.Add(neededImage.Clone(rectDimensions, neededImage.PixelFormat));   Where splitBitmaps is a List&lt;BitMap&gt; BUT this works in VB for at least 4 iterations:  arlSplitBitmaps.Add(Image.Clone(rectDimensions, Image.PixelFormat))  Where arlSplitBitmaps is a simple array list.  (And yes I've tried arraylist in c#)  This is the fullsection:  for (Int32 splitIndex = 0; splitIndex &lt;= numberOfResultingImages - 1; splitIndex++) {    Rectangle rectDimensions;    if (splitIndex &lt; numberOfResultingImages - 1)    {     rectDimensions = new Rectangle(splitImageWidth * splitIndex, 0,        splitImageWidth, splitImageHeight);    }    else    {     rectDimensions = new Rectangle(splitImageWidth * splitIndex, 0,       sourceImageWidth - (splitImageWidth * splitIndex), splitImageHeight);    }     splitBitmaps.Add(neededImage.Clone(rectDimensions, neededImage.PixelFormat));    }   neededImage is a Bitmap by the way.   I can't find any useful answers on the intarweb, especially not why it works just fine in VB.  Update:  I actually found a reason (sort of) for this working but forgot to post it.  It has to do with converting the image to a bitmap instead of just trying to clone the raw image if I remember.
72820
It's very easy to mark an image file to become an embedded resource however how does one access the image thereafter. Please can I have some example code?
70680
I was loading an image resource with the following code and it works fine from my dev environment (netbeans) but threw an exception as soon as it ran from the desktop.  new ImageIcon(Images.class.getResource("images/highlighter24.gif"));   I traced it down to my file having different case than in the code.  Fine, my bad, but why the inconsistent behavior?  Gremlins?  Note: I'm running on windows before you ask.
32842
I have a  to which I'd like to add JPEG and PNG images that I generate on the fly.  All the examples I've seen so far in the , specially in the  use ImageIcons.  I'm generating these images as byte arrays, and they are usually larger than the common icon they use in the examples, at 640x480.   Is there any (performance or other) problem in using the ImageIcon class to display an image that size in a JPanel? What's the usual way of doing it? How to add an image to a JPanel without using the ImageIcon class?   Edit: A more careful examination of the tutorials and the API shows that you cannot add an ImageIcon directly to a JPanel. Instead, they achieve the same effect by setting the image as an icon of a JLabel. This just doesn't feel right...
52967
I followed the guide here:   I unwrapped my UV, created a new image, created an Image Texture node and selected my new image with that, and hit bake. I then receive the error in the title. Here is a screenshot of my view:   I'm definitely doing something wrong, hopefully one of you can point out what that is.
76750
Full:    Cropped   :    In the second image (cropped) which is the same as the first (full) image... why the 1st Gate outputs "0"?
14269
Simple idea: I have two images that I want to merge, one is 500x500 that is transparent in the middle the other one is 150x150.  Basic idea is this: Create an empty canvas that is 500x500, position the 150x150 image in the middle of the empty canvas and then copy the 500x500 image over so that the transparent middle of it allows the 150x150 to shine through.  I know how to do it in Java, PHP and Python... I just don't have any idea what objects/classes to use in C#, a quick example of copying an images into another would suffice.
29163
I'm inserting an image with a simple:  \includegraphics[height=5cm]{filename.png}   This results in an image that maintains the aspect ratio, and so gives me something like 6cm width. I only really want the left side of the image though, and would like to crop it to 50% width. Is it possible to do this?  If possible, I'd like to do this in a portable way (i.e. something that other authors of this document won't have to install packages for, and something that works with a reasonably old version of pdflatex - our computers at work are in sore need of an upgrade).
5926
What is the best way to copy the contents of one stream to another? Is there a standard utility method for this?
31977
I've got some code that resizes an image so I can get a scaled chunk of the center of the image - I use this to take a UIImage and return a small, square representation of an image, similar to what's seen in the album view of the Photos app. (I know I could use a UIImageView and adjust the crop mode to achieve the same results, but these images are sometimes displayed in UIWebViews).  I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either is on-base.  Theory 1) I achieve the cropping by drawing into an offscreen image context of my target size. Since I want the center portion of the image, I set the CGRect argument passed to drawInRect to something that's larger than the bounds of my image context. I was hoping this was Kosher, but am I instead attempting to draw over other memory that I shouldn't be touching?  Theory 2) I'm doing all of this in a background thread. I know there are portions of UIKit that are restricted to the main thread. I was assuming / hoping that drawing to an offscreen view wasn't one of these. Am I wrong?  (Oh, how I miss NSImage's drawInRect:fromRect:operation:fraction: method.)
4199
A   B   C   D   E   F             I don't even know. It just seemed weird.  Yes, I understand I could just avoid doing something like that. But the problem already exists with a single level.   Consider having 2 images in a post. Both exceed the maximum width of a post. One is nested in a list. Key to this issue is that my original images were much larger. They were automatically resized.  Image    List      I think it looks weird.
15810
Does anyone have any ideas how to go about achieving rotational pixel-perfect collision detection with Bitmaps in Android? Or in general for that matter? I have pixel arrays currently but I don't know how to manipulate them based on an arbitrary number of degrees.
107843
What is a good (and preferably free) tool for finding photo duplicates based on the photos themselves?  So, not filename, filesize etc., but how the photos look like. It would be nice if it managed to match photos that were the same image, but not exactly the same size for example too.
98165
This is my second time making and game and I want to make sure that I fit under 50 mbs. So far my plan is to fit all the games artwork into two 2048x2048 sprite sheets. I tested a empty unity3d project and when the apk was made it was 19 035 KB of size. Where does this overhead come from and how can I reduce it?  This is not a duplicate question of this . I'm asking why building a completely empty project results in a apk with a size of 19 MB. Does this mean that I have limit my assets to 30 MB so that the complete app will be less than 50 or is there a way to strip some of those initial 19 MB.
92219
Is there a method to create a copy of an animated gif image using C#?  What I want is to generate a copy of a given gif image using the height and width parameters that the user provides. I have tried for a couple of hours to accomplish this but the resulting image does not preserve the original animations.
48001
As all Illustrator users know, there is a hard limit on the size you can export a PNG file. I'm curious if anyone knows the maximum limit on this, and if it differs depending on the DPI of the exported PNG file.  For my immediate needs I am interested in a 300 DPI export, but curious what the dimension limit is for 72, 150 if it's dependent on the DPI.
14268
I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick research I found  and others saying on Windows machine the JVM defaults max heap size as 64MB.  Given this situation, how should I deal with this constraint?  I could increase the max heap size using command line option to java, but that would require figuring out available RAM and writing some launching program or script. Besides, increasing to some finite max does not ultimately get rid of the issue.  I could rewrite some of my code to persist objects to file system frequently (using database is the same thing) to free up the memory. It could work, but it's probably a lot work too.  If you could point me to details of above ideas or some alternatives like automatic virtual memory, extending heap size dynamically, that will be great.