public void CenterAndFit() { ImageWidth = MaxWidth; ImageHeight = MaxHeight; OffsetX = (TotalWidth - ImageWidth) / 2; OffsetY = (TotalHeight - ImageHeight) / 2; }