Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 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];
        }
Ejemplo n.º 3
0
 public void OnScreenCaptured(ScreenCaptureImageInfo bitmap)
 {
     ScreenCaptured?.Invoke(this, bitmap);
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Called when [screep captured].
 /// </summary>
 /// <param name="bitmap">The bitmap.</param>
 protected virtual void OnScreepCaptured(Bitmap bitmap)
 {
     ScreenCaptured?.Invoke(this, bitmap);
 }