ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / Multipatch Class / GetMaterialTextureRowCount 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.
Example

In This Topic
    GetMaterialTextureRowCount Method
    In This Topic
    Gets the number of rows (height in pixels) of the texture contained in the specified material index.
    Syntax
    Public Function GetMaterialTextureRowCount( _
       ByVal materialIndex As Integer _
    ) As Integer
    public int GetMaterialTextureRowCount( 
       int materialIndex
    )

    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 rows (height in pixels) of the texture.
    Exceptions
    ExceptionDescription
    The material index must be >= 0.
    The material index must be less than the number of materials in the multipatch.
    Example
    Multipatch Properties
    {
      int patchIndex = 0;
    
      // standard geometry properties
      bool hasZ = multipatch.HasZ;
      bool hasM = multipatch.HasM;
      bool hasID = multipatch.HasID;
      bool isEmpty = multipatch.IsEmpty;
      var sr = multipatch.SpatialReference;
    
      // number of patches (parts)
      int patchCount = multipatch.PartCount;
      // number of points
      int pointCount = multipatch.PointCount;
    
      // retrieve the points as MapPoints
      ReadOnlyPointCollection pointsMultipatch = multipatch.Points;
      // or as 3D Coordinates
      IReadOnlyList<Coordinate3D> coordinates = multipatch.Copy3DCoordinatesToList();
    
    
      // multipatch materials
      bool hasMaterials = multipatch.HasMaterials;
      int materialCount = multipatch.MaterialCount;
    
    
      // multipatch textures
      bool hasTextures = multipatch.HasTextures;
      int textureVertexCount = multipatch.TextureVertexCount;
    
      // normals
      bool hasNormals = multipatch.HasNormals;
    
    
      // properties for an individual patch (if multipatch.PartCount > 0)
      int patchPriority = multipatch.GetPatchPriority(patchIndex);
      PatchType patchType = multipatch.GetPatchType(patchIndex);
    
      // patch points
      int patchPointCount = multipatch.GetPatchPointCount(patchIndex);
      int pointStartIndex = multipatch.GetPatchStartPointIndex(patchIndex);
      // the patch Points are then the points in multipatch.Points from pointStartIndex to pointStartIndex + patchPointCount 
    
      // if the multipatch has materials 
      if (hasMaterials)
      {
        // does the patch have a material?  
        //   materialIndex = -1 if the patch does not have a material; 
        //   0 <= materialIndex < materialCount if the patch does have materials
        int materialIndex = multipatch.GetPatchMaterialIndex(patchIndex);
    
    
        // properties for an individual material (if multipatch.MaterialCount > 0)
        var color = multipatch.GetMaterialColor(materialIndex);
        var edgeColor = multipatch.GetMaterialEdgeColor(materialIndex);
        var edgeWidth = multipatch.GetMaterialEdgeWidth(materialIndex);
        var shiness = multipatch.GetMaterialShininess(materialIndex);
        var percent = multipatch.GetMaterialTransparencyPercent(materialIndex);
        var cullBackFace = multipatch.IsMaterialCullBackFace(materialIndex);
    
        // texture properties
        bool isTextured = multipatch.IsMaterialTextured(materialIndex);
        if (isTextured)
        {
          int columnCount = multipatch.GetMaterialTextureColumnCount(materialIndex);
          int rowCount = multipatch.GetMaterialTextureRowCount(materialIndex);
          int bpp = multipatch.GetMaterialTextureBytesPerPixel(materialIndex);
          TextureCompressionType compressionType = multipatch.GetMaterialTextureCompressionType(materialIndex);
          var texture = multipatch.GetMaterialTexture(materialIndex);
        }
      }
    
      // texture coordinates (if multipatch.HasTextures = true)
      if (hasTextures)
      {
        int numPatchTexturePoints = multipatch.GetPatchTextureVertexCount(patchIndex);
        var coordinate2D = multipatch.GetPatchTextureCoordinate(patchIndex, 0);
    
        ICollection<Coordinate2D> textureCoordinates = new List<Coordinate2D>(numPatchTexturePoints);
        multipatch.GetPatchTextureCoordinates(patchIndex, ref textureCoordinates);
      }
    
    
      // patch normals (if multipatch.HasNormals = true)
      if (hasNormals)
      {
        //  number of normal coordinates = multipatch.GetPatchPointCount(patchIndex)
        Coordinate3D patchNormal = multipatch.GetPatchNormal(patchIndex, 0);
        ICollection<Coordinate3D> normalCoordinates = new List<Coordinate3D>(patchPointCount);
        multipatch.GetPatchNormals(patchIndex, ref normalCoordinates);
      }
    }
    Get the material properties of a multipatch
    {
      if (multipatch.HasMaterials)
      {
        int patchIndex = 0;
        // 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 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also