DisplayBitmap

References
public class DisplayBitmap : IDisposable
A bitmap resource that can be used by the display pipeline (currently only in OpenGL display). Reuse DisplayBitmaps for drawing if possible; it is much more expensive to construct new DisplayBitmaps than it is to reuse existing DisplayBitmaps.

Constructors

DisplayBitmap

#Since v5.0
public DisplayBitmap(Bitmap bitmap)
Constructs a DisplayBitmap from an existing bitmap.
bitmap (Bitmap)The original bitmap.

DisplayBitmap

#Since v7.16
public DisplayBitmap(string path, Bitmap bitmap)
Creates a DisplayBitmap either from a path, or a bitmap. If the path is null, a random tag name will be used. If the bitmap is null, the bitmap will be loaded from the path. If both are null, the object is invalid. if both are valid objects, the bitmap will be used and it will be added to Rhino's bitmap cache with the path supplied. In other words, this is a way to add a bitmap from memory directly into Rhino's memory cache.
path (string)If null, use a temporary tag name. If non-null, use that path in Rhino's bitmap cache. Note, this version does not support URLs.
bitmap (Bitmap)If null, load the bitmap from the supplied path. If non-null, creates the bitmap from the data supplied.

Finalizer

~DisplayBitmap

#
~DisplayBitmap()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

Properties

Size

#Since v7.0
public Size Size { get; }
Size of the underlying bitmap image

Methods

Dispose

#Since v5.0
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.

Dispose

#
protected virtual void Dispose(bool disposing)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

disposing (bool)true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.

GetBlendModes

#Since v5.0
public void GetBlendModes(out BlendMode source, out BlendMode destination)
Gets the source and destination blend modes.
source (out BlendMode)The source blend mode is assigned to this out parameter.
destination (out BlendMode)The destination blend mode is assigned to this out parameter.

Load

#Since v5.0
public static DisplayBitmap Load(string path)
Load a DisplayBitmap from and image file on disk or from URL. If path starts with http:// or https:// then an attempt is made to load the bitmap from an online resource
path (string)A location from which to load the file.
The new display bitmap, or null on error.

SetBlendFunction

#Since v5.0
public void SetBlendFunction(BlendMode source, BlendMode destination)
Sets blending function used to determine how this bitmap is blended with the current frame buffer color. The default setting is SourceAlpha for source and OneMinusSourceAlpha for destination. See OpenGL's glBlendFunc for details.

http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml

source (BlendMode)The source blend mode.
destination (BlendMode)The destination blend mode.

Update

#Since v8.14
public void Update(Bitmap bitmap)
Update the image used for this DisplayBitmap
bitmap (Bitmap)