ArcGIS Pro 2.6 API Reference Guide
GetMaterialTextureBytesPerPixel Method
Example 

ArcGIS.Core.Geometry Namespace > Multipatch Class : GetMaterialTextureBytesPerPixel Method
The index of the material. Must be greater than or equal to zero and less than MaterialCount. Get the index for a patch by calling GetPatchMaterialIndex.
Gets the number of bytes per pixel of the texture contained in the specified material.
Syntax
public int GetMaterialTextureBytesPerPixel( 
   int materialIndex
)
Public Function GetMaterialTextureBytesPerPixel( _
   ByVal materialIndex As Integer _
) As Integer

Parameters

materialIndex
The index of the material. Must be greater than or equal to zero and less than MaterialCount. Get the index for a patch by calling GetPatchMaterialIndex.

Return Value

The number of bytes per pixel of the texture contained in the material.
Exceptions
ExceptionDescription
The material index must be >= 0.
The material index must be less than the number of materials in the multipatch.
Remarks
The number of bytes per pixel signifies how many bands exist in the material. The minimum value of the property is 1 and the maximum is 4. The fourth channel is usually the alpha channel used for material pixel transparency, for instance, the 'A' in 'RGBA'.
Example
/// <summary>
/// This method gets several properties of a material in a multipatch.
/// This method must be called on the MCT. Use QueuedTask.Run.
/// </summary>
/// <param name="multipatch">The input multipatch.</param>
/// <param name="patchIndex">The index of the patch (part) from which to get the material properties.</param>
public void GetMaterialProperties(Multipatch multipatch, int patchIndex)
{
  if (multipatch.HasMaterials)
  {
    // Get the material index for the specified patch.
    int materialIndex = multipatch.GetPatchMaterialIndex(patchIndex);

    System.Windows.Media.Color color = multipatch.GetMaterialColor(materialIndex);
    int tranparencyPercent = multipatch.GetMaterialTransparencyPercent(materialIndex);
    bool isBackCulled = multipatch.IsMaterialCullBackface(materialIndex);

    if (multipatch.IsMaterialTextured(materialIndex))
    {
      int bpp = multipatch.GetMaterialTextureBytesPerPixel(materialIndex);
      int columnCount = multipatch.GetMaterialTextureColumnCount(materialIndex);
      int rowCount = multipatch.GetMaterialTextureRowCount(materialIndex);
    }
  }
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

Multipatch Class
Multipatch Members