Get image content rectangle without margins

JPG PNG TIFF BMP GIF ICO C# VB