Get image content rectangle without margins

JPG PNG TIFF BMP GIF C# VB