I found this on a blog some years ago, but cannot find the original. This is my modified version of the blog. It's C++ but the principles are the same, converting it to C# should not be too difficult:
::GetClientRect(hWnd, &rectWindow);
destRect.X = static_cast<real>(rectWindow.left);
destRect.Y = static_cast<real>(rectWindow.top);
destRect.Width = static_cast<real>((rectWindow.right - rectWindow.left));
destRect.Height = static_cast<real>((rectWindow.bottom - rectWindow.top));
imageWidth = static_cast<real>(pImage->GetWidth());
imageHeight = static_cast<real>(pImage->GetHeight());
if (imageWidth < destRect.Width)
destRect.Width = imageWidth;
if (imageHeight < destRect.Height)
destRect.Height = imageHeight;
if (imageWidth > destRect.Width)
{
aspect = imageHeight / imageWidth;
REAL newHeight = destRect.Width * aspect;
if (newHeight <= destRect.Height)
destRect.Height = newHeight;
}
if (imageHeight > destRect.Height)
{
aspect = imageWidth / imageHeight;
destRect.Width = destRect.Height * aspect;
}