public virtual System.Drawing.Image GetImageWithSize(int?size) { if (size != null && Frames != null && Control.Size.Width > size.Value) { var src = Frames.Aggregate((x, y) => Math.Abs(x.Size.Width - size.Value) < Math.Abs(y.Size.Width - size.Value) ? x : y); if (src != null) { return(src.ToBitmap().ToSD()); } } return(sdimage ?? (sdimage = Control.ToSD())); }