I have a problem with image scaling in .NET. I use the standard Graphics type to resize images like in this example:
public static Image Scale(Image sourceIm
The problem lies in the fact that your bitmap toReturn
has a black background by default.
Copying a new image over it makes black or gray borders.
The solution is to remove the black default background, by calling:
toReturn.MakeTransparent();
Since after this line you'll be drawing on a new image without any background color the borders will disappear.