Class RenderArgs
- Namespace
- PaintDotNet
- Assembly
- PaintDotNet.Core.dll
Encapsulates the arguments passed to a Render function. This way we can do on-demand and once-only creation of Bitmap and Graphics objects from a given Surface object.
public sealed class RenderArgs : Disposable, IIsDisposed, IDisposable
- Inheritance
-
RenderArgs
- Implements
- Inherited Members
Remarks
Use of the Bitmap and Graphics objects is not thread safe because of how GDI+ works. You must wrap use of these objects with a critical section, like so: object lockObject = new object(); lock (lockObject) { Graphics g = ra.Graphics; g.DrawRectangle(...); // etc. }
Constructors
- RenderArgs(Surface)
Creates an instance of the RenderArgs class.
Properties
- Bitmap
Gets a Bitmap reference that aliases the Surface.
- Bounds
Gets the size of the associated Surface object.
- Graphics
Retrieves a Graphics instance that can be used to draw on to the Surface.
- Height
Gets the height of the associated Surface object.
- Size
Gets the size of the associated Surface object.
- Surface
Gets the Surface that has been associated with this instance of RenderArgs.
- Width
Gets the width of the associated Surface object.