protected override void OnPaint(CefBrowser browser, CefPaintElementType type, CefRectangle[] dirtyRects, IntPtr buffer, int width, int height) { try { _imageElement?.SetBitmap(new Bitmap(width, height, width * 4, PixelFormat.Format32bppArgb, buffer)); } catch (Exception ex) { LogManager.CefLog(ex, "CEF PAINT"); } }
internal static void SetMouseHidden(bool hidden) { if (DirectXHook == null) { return; } if (_cursor == null) { var cursorPic = new Bitmap(Main.GTANInstallDir + "images\\cef\\cursor.png"); _cursor = new ImageElement(null, true); _cursor.SetBitmap(cursorPic); _cursor.Hidden = true; DirectXHook.AddImage(_cursor, 1); } _cursor.Hidden = hidden; }