コード例 #1
0
        internal protected virtual bool GetScreenInfo(CefBrowser browser, ref CefScreenInfo screenInfo)
        {
            if (WebView.GetCefScreenInfo(ref screenInfo))
            {
                return(true);
            }

            if (!PlatformInfo.IsWindows)
            {
                return(false);
            }

            float  devicePixelRatio = WebView.GetDevicePixelRatio();
            IntPtr hMonitor         = NativeMethods.MonitorFromWindow(IntPtr.Zero, MonitorFlag.MONITOR_DEFAULTTOPRIMARY);

            var monitorInfo = new MONITORINFO();

            monitorInfo.Size = Marshal.SizeOf(typeof(MONITORINFO));
            NativeMethods.GetMonitorInfo(hMonitor, ref monitorInfo);

            screenInfo.Depth             = 24;
            screenInfo.DepthPerComponent = 24;
            screenInfo.DeviceScaleFactor = devicePixelRatio;

            CefRect rect;

            rect = monitorInfo.Monitor.ToCefRect();
            rect.Scale(1.0f / devicePixelRatio);
            screenInfo.Rect = rect;

            rect = monitorInfo.Work.ToCefRect();
            rect.Scale(1.0f / devicePixelRatio);
            screenInfo.AvailableRect = rect;
            return(true);
        }
コード例 #2
0
 protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
 {
     screenInfo.Depth              = 32;
     screenInfo.DepthPerComponent  = 8;
     screenInfo.AvailableRectangle = new CefRectangle(0, 0, _width, _height);
     screenInfo.Rectangle          = new CefRectangle(0, 0, _width, _height);
     return(false);
 }
コード例 #3
0
 protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
 {
     if (screenInfo != null)
     {
         return(false);
     }
     return(false);
 }
コード例 #4
0
        protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
        {
            var rect = screenInfo.Rectangle;

            this.GetRootScreenRect(browser, ref rect);
            screenInfo.Depth        = 32;
            screenInfo.IsMonochrome = false;

            return(true);
        }
コード例 #5
0
ファイル: WebClient.cs プロジェクト: vvvv/VL.CEF
            protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
            {
                GetViewRect(browser, out var viewRect);

                screenInfo.DeviceScaleFactor  = renderer.ScaleFactor;
                screenInfo.Rectangle          = viewRect;
                screenInfo.AvailableRectangle = viewRect;

                return(true);
            }
コード例 #6
0
ファイル: WebView.Offscreen.cs プロジェクト: jingyiliu/CefNet
        protected virtual bool GetCefScreenInfo(ref CefScreenInfo screenInfo)
        {
            VirtualDevice device = Device;

            if (device == null)
            {
                return(false);
            }
            screenInfo = device.ScreenInfo;
            return(true);
        }
コード例 #7
0
        protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
        {
            var handle = _owner.HostWindowHandle;

            var screen = Screen.FromHandle(handle);

            screenInfo.DeviceScaleFactor = DpiHelper.GetScaleFactorForCurrentWindow(handle);

            GetViewRect(browser, out var rectView);

            screenInfo.Rectangle = rectView;

            screenInfo.AvailableRectangle = rectView;//new CefRectangle(screen.WorkingArea.X, screen.WorkingArea.Y, screen.WorkingArea.Width, screen.WorkingArea.Height);

            return(true);
        }
コード例 #8
0
        } // End Sub GetViewRect

        protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
        {
            System.Console.WriteLine("GetScreenInfo");

            return(false);
        } // End Function GetScreenInfo
コード例 #9
0
 protected internal unsafe override bool GetScreenInfo(CefBrowser browser, ref CefScreenInfo screenInfo)
 {
     return(_implementation.GetScreenInfo(browser, ref screenInfo));
 }
コード例 #10
0
ファイル: RenderHandler.cs プロジェクト: PlumpMath/CefPaste
 protected override Boolean GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
 {
     Log.Trace("RenderHandler.GetScreenInfo( browser: {0} )", browser.Identifier);
     return(false);
 }
コード例 #11
0
 protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
 {
     return false;
 }
コード例 #12
0
ファイル: WebView.Offscreen.cs プロジェクト: jingyiliu/CefNet
 bool IChromiumWebViewPrivate.GetCefScreenInfo(ref CefScreenInfo screenInfo)
 {
     return(GetCefScreenInfo(ref screenInfo));
 }
コード例 #13
0
 protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
 {
     //throw new NotImplementedException();
     return(true);
 }
コード例 #14
0
 public override bool GetScreenInfo(CefBrowser browser, ref CefScreenInfo screenInfo)
 {
     return(_implementation.GetScreenInfo(browser, ref screenInfo));
 }
コード例 #15
0
 protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
 {
     return(true);
 }