// Copyright © 2018 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.Wpf { /// /// Event arguments for the Paint event handler. /// /// public class PaintEventArgs : EventArgs { /// /// Is the OnPaint call for a Popup or the Main View /// public bool IsPopup { get; private set; } /// /// contains the set of rectangles in pixel coordinates that need to be repainted /// public Rect DirtyRect { get; private set; } /// /// Pointer to the unmanaged buffer that holds the bitmap. /// The buffer shouldn't be accessed outside the scope of event. /// A copy should be taken as the buffer is reused internally and may potentialy be freed. /// /// The bitmap will be width * height * 4 bytes in size and represents a BGRA image with an upper-left origin public IntPtr Buffer { get; private set; } /// /// Width /// public int Width { get; private set; } /// /// Height /// public int Height { get; private set; } /// /// Gets or sets a value indicating whether the event is handled. /// public bool Handled { get; set; } /// /// Initializes a new instance of the class. /// /// is popup /// direct rectangle /// buffer /// width /// height public PaintEventArgs(bool isPopup, Rect dirtyRect, IntPtr buffer, int width, int height) { IsPopup = isPopup; DirtyRect = dirtyRect; Buffer = buffer; Width = width; Height = height; } } }