/// <summary> /// Load a Greenshot surface /// </summary> /// <param name="fullPath"></param> /// <param name="returnSurface"></param> /// <returns></returns> public static ISurface LoadGreenshotSurface(string fullPath, ISurface returnSurface) { if (string.IsNullOrEmpty(fullPath)) { return(null); } Log.InfoFormat("Loading image from file {0}", fullPath); // Fixed lock problem Bug #3431881 using (Stream surfaceFileStream = File.OpenRead(fullPath)) { returnSurface = ImageHelper.LoadGreenshotSurface(surfaceFileStream, returnSurface); } if (returnSurface != null) { Log.InfoFormat("Information about file {0}: {1}x{2}-{3} Resolution {4}x{5}", fullPath, returnSurface.Image.Width, returnSurface.Image.Height, returnSurface.Image.PixelFormat, returnSurface.Image.HorizontalResolution, returnSurface.Image.VerticalResolution); } return(returnSurface); }