BitmapExtensions

public static class BitmapExtensions
Rhino specific extension methods for System.Drawing.Bitmap

Methods

BitmapAsTextureFileReference

#ExampleSince v7.7
Inserts bitmap into Rhino's texture manager and returns a FileReference.
[CLSCompliant(false)] public static FileReference BitmapAsTextureFileReference(
this Bitmap
bitmap,
The bitmap which will be referenced by the FileReference.
crc
The crc of the bitmap. This should be a unique number which changes if the contents of the bitmap changes. NOTE: if a different bitmap is provided using the same crc as a previous bitmap, then the previous bitmap will be overwritten in the texture manager and both previously returned FileReferences will reference the newly provided bitmap.
)

ConvertToNormalMap

#ExampleSince v7.5
Use this function to convert a System.Drawing.Bitmap from a bump to a normal texture
public static Bitmap ConvertToNormalMap(
this Bitmap
bitmap,
bLossyCompressionSource,
True if the source of the bitmap is an image with lossy compression (e.g. jpg). False otherwise. The check will be less strict if the image can contain errors due to lossy compression.
out bool
bPositiveZComponent
True if the image is a normal map with the z-component mapped to the range 0 .. +1. False if the image is a normal map with the z-component mapped to the range -1 .. +1.
)

IsNormalMap

#ExampleSince v7.5
Call this method to see if the DIB appears to be a normal map.
public static bool IsNormalMap(
this Bitmap
bitmap,
bLossyCompressionSource,
True if the source of the bitmap is an image with lossy compression (e.g. jpg). False otherwise. The check will be less strict if the image can contain errors due to lossy compression.
out bool
bPositiveZComponent
True if the image is a normal map with the z-component mapped to the range 0 .. +1. False if the image is a normal map with the z-component mapped to the range -1 .. +1.
)
Returns true if the bitmap appears to be a normal map. False otherwise.