protected void Draw(IEditableFrame Editor, IBitmapImage Image, PointF Position, SizeF?Size, int Opacity) { if (Image == null) { return; } var targetSize = Size ?? new Size(Image.Width, Image.Height); try { //var point = GetPosition(new Size((int)Editor.Width, (int)Editor.Height), targetSize); var destRect = new RectangleF(Position, targetSize); Editor.DrawImage(Image, destRect, Opacity); } catch { } finally { if (_disposeImages) { Image.Dispose(); } } }
public async Task SaveScreenShot(IBitmapImage Bmp, string FileName = null) { _audioPlayer.Play(SoundKind.Shot); if (Bmp != null) { var allTasks = AvailableImageWriters .Where(M => M.Active) .Select(M => M.Save(Bmp, _settings.ScreenShots.ImageFormat, FileName)); await Task.WhenAll(allTasks).ContinueWith(T => Bmp.Dispose()); } else { _systemTray.ShowNotification(new TextNotification(_loc.ImgEmpty)); } }
public override void Dispose() { _bmp?.Dispose(); }