internal void OnScreenCaptured(object sender, BitmapSource caputredBmp)
        {
            var filePath = Environment.GetEnvironmentVariable("TEMP") + @"\" + Guid.NewGuid().ToString("N") + ".png";

            caputredBmp.SaveImageToFile(filePath);
            //Clipboard.SetFileDropList(new System.Collections.Specialized.StringCollection { filePath });
            var dataObject = new DataObject();

            dataObject.SetData(DataFormats.FileDrop, new string[] { filePath });
            Clipboard.SetDataObject(dataObject, true);
            //Clipboard.SetImage(e.Bmp);直接保存图片到剪贴板
            ScreenCaptured?.Invoke(sender, new ScreenCapturedEventArgs(caputredBmp));
        }
Exemple #2
0
        public ThreadedRenderer(IRenderer renderer)
        {
            _baseRenderer = renderer;

            renderer.ScreenCaptured += (object sender, ScreenCaptureImageInfo info) => ScreenCaptured?.Invoke(this, info);

            Pipeline = new ThreadedPipeline(this, renderer.Pipeline);
            Window   = new ThreadedWindow(this, renderer);
            Buffers  = new BufferMap();
            Sync     = new SyncMap();
            Programs = new ProgramQueue(renderer);

            _galWorkAvailable = new ManualResetEventSlim(false);
            _invokeRun        = new ManualResetEventSlim();
            _spanPool         = new CircularSpanPool(this, SpanPoolBytes);
            SpanPool          = _spanPool;

            _elementSize = BitUtils.AlignUp(CommandHelper.GetMaxCommandSize(), 4);

            _commandQueue = new byte[_elementSize * QueueCount];
            _refQueue     = new object[MaxRefsPerCommand * QueueCount];
        }
Exemple #3
0
 public void OnScreenCaptured(ScreenCaptureImageInfo bitmap)
 {
     ScreenCaptured?.Invoke(this, bitmap);
 }
 /// <summary>
 ///     Called when [screep captured].
 /// </summary>
 /// <param name="bitmap">The bitmap.</param>
 protected virtual void OnScreepCaptured(Bitmap bitmap)
 {
     ScreenCaptured?.Invoke(this, bitmap);
 }