ArcGIS Pro 2.7 API Reference Guide
TextureResource Constructor(Texture)
Example 

ArcGIS.Core.Geometry Namespace > TextureResource Class > TextureResource Constructor : TextureResource Constructor(Texture)
The new texture which is assigned by reference.
Initializes a new instance of the TextureResource.
Syntax
public TextureResource( 
   Texture texture
)
Public Function New( _
   ByVal texture As Texture _
)

Parameters

texture
The new texture which is assigned by reference.
Example
// read the jpeg into a buffer
System.Drawing.Image image = System.Drawing.Image.FromFile(@"C:\temp\myImageFile.jpg");
MemoryStream memoryStream = new MemoryStream();

System.Drawing.Imaging.ImageFormat format = System.Drawing.Imaging.ImageFormat.Jpeg;
image.Save(memoryStream, format);
byte[] imageBuffer = memoryStream.ToArray();

var jpgTexture = new JPEGTexture(imageBuffer);

// texture properties
int bpp = jpgTexture.BytesPerPixel;
int columnCount = jpgTexture.ColumnCount;
int rowCount = jpgTexture.RowCount;

// build the textureResource and the material
BasicMaterial material = new BasicMaterial();
material.TextureResource = new TextureResource(jpgTexture);
UncompressedTexture uncompressedTexture1 = new UncompressedTexture(new byte[10 * 12 * 3], 10, 12, 3);

// texture properties
int bpp = uncompressedTexture1.BytesPerPixel;
int columnCount = uncompressedTexture1.ColumnCount;
int rowCount = uncompressedTexture1.RowCount;

// build the textureResource and the material
TextureResource tr = new TextureResource(uncompressedTexture1);
BasicMaterial material = new BasicMaterial();
material.TextureResource = tr;
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

TextureResource Class
TextureResource Members
Overload List