Class PNGToTanvasTouch
Helper functions for converting PNGs to friction maps.
Inheritance
System.Object
PNGToTanvasTouch
Namespace: Tanvas.TanvasTouch.WpfUtilities
Assembly: Tanvas.TanvasTouch.WpfUtilities.dll
Syntax
public class PNGToTanvasTouch : object
Methods
CreateHapticData(BitmapSource)
Creates texture data from a bitmap source.
Declaration
public static byte[] CreateHapticData(BitmapSource bitmapSource)
Parameters
Type | Name | Description |
---|---|---|
BitmapSource | bitmapSource | Bitmap source of the data. |
Returns
Type | Description |
---|---|
System.Byte[] | Byte array of texture data suitable for a TTexture. |
Remarks
The bitmap format must be a format recognized by WPF's
CreateMaterialFromPNG(Uri)
Creates a TMaterial with a texture that was created from the PNG at the URI.
Declaration
public static TMaterial CreateMaterialFromPNG(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | URI pointing to a PNG. |
Returns
Type | Description |
---|---|
TMaterial | A TMaterial created from the PNG. |
CreateSpriteFromPNG(Uri)
Declaration
public static TSprite CreateSpriteFromPNG(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | URI pointing to a PNG. |
Returns
Type | Description |
---|---|
TSprite | A TSprite created from the PNG or null if it could not be created. |
Remarks
This does not add the sprite to a TView.
CreateTextureFromPNG(Uri)
Creates a TTexture with PNG data read from the supplied URI.
Declaration
public static TTexture CreateTextureFromPNG(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | URI pointing to the PNG with the haptic data. |
Returns
Type | Description |
---|---|
TTexture | A TTexture containing a data read from the PNG. |