public void Scale(double d) { OffsetX -= (Math.Max(ImageWidth*d, MinWidth) - ImageWidth)/2; OffsetY -= (Math.Max(ImageHeight*d, MinHeight) - ImageHeight)/2; ImageWidth *= d; ImageHeight *= d; }