-1

I'm trying to re-size my sprites to make them the proper size so they get drawn correctly, but I cant seem to find why I'm getting an unhandled ArgumentExepction when I'm making the new Bitmap object.

public static Image prepareImage(Image original, Size size)
{
     Bitmap newImage = new Bitmap(original, size);
     return (Image)newImage;
}
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
  • Please include the complete exception traceback in your question – codeape Aug 09 '15 at 19:36
  • An ArgumentExepction exception means that you are passing a bag value to the `Bitmap` constructor. Is `orignal` a valid image? Is `size` a valid size (e.g. negative?) – shf301 Aug 09 '15 at 19:46
  • the Image parameter that I'm using is from my Properties.Resources directory. I've used them from there before and i do not know what I'm doing differently. The size is set to 20x20 – user2884232 Aug 09 '15 at 19:48

1 Answers1

0

There was an error in the way the Size object parameter was initialized. Changing that fixed the problem.