// Copyright © 2017 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; using CefSharp.Structs; namespace CefSharp.OffScreen { /// /// Event arguments to the OnPaint event handler. /// Pixel values are scaled relative to view coordinates based on the value of ScreenInfo.DeviceScaleFactor /// returned from . /// public class OnPaintEventArgs : EventArgs { /// /// Gets or sets a value indicating whether the event is handled. /// public bool Handled { get; set; } /// /// Indicates whether the element is the view or the popup widge /// public bool IsPopup { get; private set; } /// /// Width /// public int Width { get; private set; } /// /// Height /// public int Height { get; private set; } /// /// contains the pixel data for the whole image. Will be width * height * 4 bytes in size and /// represents a BGRA image with an upper-left origin /// public IntPtr BufferHandle { get; private set; } /// /// Contains a rectangle in pixel coordinates that needs to be repainted. /// public Rect DirtyRect { get; private set; } /// /// Creates a new OnPaint event arg /// /// is popup /// dirty rect if enabled /// buffer handle (back buffer) /// width /// height public OnPaintEventArgs(bool isPopup, Rect dirtyRect, IntPtr bufferHandle, int width, int height) { IsPopup = isPopup; DirtyRect = dirtyRect; BufferHandle = bufferHandle; Width = width; Height = height; } } }