Centering a dynamc width height rectangle in constant sized square
i get an image from a folder and draw it over a white btimap as in the
following code
Image newImage = new Bitmap(whitesize, whitesize);
using (Graphics graphicsHandle = Graphics.FromImage(newImage))
{
graphicsHandle.InterpolationMode =
InterpolationMode.HighQualityBicubic;
graphicsHandle.FillRectangle(System.Drawing.Brushes.White,0,0,whitesize,whitesize);
graphicsHandle.CompositingMode = CompositingMode.SourceOver;
graphicsHandle.DrawImage(image, whitesize/2, 0, newWidth,
newHeight);
}
whitesize is the square width and height
dividing whitesize by 2 wont work, because newWidth and newHeight