MapWinGIS:AxMap UDPointImageListItem

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

UDPointImageListItem

Allows you to build an image list so that one point shapefile can have multiple icons.


VB.NET Usage

Property set_UDImageListAdd(LayerHandle As Integer, NewValue As Object) As Integer

            Parameters

LayerHandle

The layer handle of the layer for which the the list is being generated.

NewValue

The new image object to be added to the list being used for the specified layer.

Property get_UDPointImageListItem(LayerHandle As Integer, imageIndex as Integer) As Object
            Parameters

LayerHandle

The layer handle of the layer for which the image list is defined.

imageIndex

The Integer index for the image to retrieve
ReturnValue The image object which is used as the point image for the specified layer.

Sample Code

     ' sf is a global shapefile variable
     ' layer is a global integer variable
      <summary>
      This function will plot different images on the map for the same shapefile by
      establishing an image list using AxMap1.set_UDPointImageListAdd and then
      setting the shapes to use the list using a point type called 
      MapWinGIS.tkPointType.ptImageList and then specifying which image to use with
      AxMap1.set_ShapePointImageList
      </summary>
     Private Sub cmdAddPoints_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddPoints.Click
         Dim result As Boolean
         Dim shp, type, I As Integer
         Dim Images(3) As MapWinGIS.Image
         Dim PointShapeFile As String
 
         'Load a point shapefile into memory 
         PointShapefile = "C:\Documents and Settings\Ted\My Documents\Fundamentals\Week 3\Lab3\DataVisualization\LIGHTS.SHP"
         sf = New MapWinGIS.Shapefile
         result = sf.Open(PointShapeFile)
         If result = False Then
             MessageBox.Show(sf.ErrorMsg(sf.LastErrorCode))
         End If
         layer = AxMap1.AddLayer(sf, True)
         AxMap1.ZoomToLayer(layer)
 
 
         ' Create an array of MapWinGIS Image objects to load the images from files
         For I = 0 To 3
             Images(I) = New MapWinGIS.Image
         Next
         Images(0).Open("C:\Dev\Unpublished\taudem\Tester\Graphics\North.bmp", MapWinGIS.ImageType.USE_FILE_EXTENSION)
         Images(1).Open("C:\Dev\Unpublished\taudem\Tester\Graphics\East.bmp", MapWinGIS.ImageType.USE_FILE_EXTENSION)
         Images(2).Open("C:\Dev\Unpublished\taudem\Tester\Graphics\South.bmp", MapWinGIS.ImageType.USE_FILE_EXTENSION)
         Images(3).Open("C:\Dev\Unpublished\taudem\Tester\Graphics\West.bmp", MapWinGIS.ImageType.USE_FILE_EXTENSION)
         For I = 0 To 3
             AxMap1.set_UDPointImageListAdd(layer, Images(I))
         Next
 
         ' Assign images from image list to points
         For shp = 0 To sf.NumShapes - 1
             AxMap1.set_ShapePointType(layer, shp, MapWinGIS.tkPointType.ptImageList)
             type = shp Mod 4 'simply assign each of the four images over and over again
             AxMap1.set_ShapePointImageListID(layer, shp, type)
         Next
 
         '  Later, if you needed to determine which images were in the list:
         For I = 0 To AxMap1.get_UDPointImageListCount(layer) - 1
             Images(I) = AxMap1.get_UDPointImageListItem(layer, I)
         Next
     End Sub

Entry added by Shade1974 on Sept. 24, 2006

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:AxMap_UDPointImageListItem"

This page has been accessed 999 times. This page was last modified on 24 September 2006, at 17:51.