MapWinGIS:Grid CellToProj
From MapWindow GIS
CellToProj
Uses a cell's column and row position to find the center of the cell in projected map coordinates.
VB.NET Usage
Sub CellToProj(Column As Integer, Row As Integer, ByRef x As Double, ByRef y As Double)
Parameters
|
Column | The column of the cell to find the center in projected map coordinates. |
| Row | The row of the cell to find the center in projected map coordinates. |
| x | Reference parameter. Returns the x projected map coordinate of the center of the specified cell. |
| y | Reference parameter. Returns the yprojected map coordinate of the center of the specified cell. |
Sample Code
Private Sub CellToProj()
Dim grid As New MapWinGIS.Grid()
Dim x As Double, y As Double
'Open a grid from disk
grid.Open("C:\grid.asc")
'Get the center of the cell in projected map coordinates stored in x and y
grid.CellToProj(5, 5, x, y)
'Display center of the cell in message box
MsgBox("The center of cell col 5, row 5: x = " + Str(x) + " y = " + Str(y))
'Close the grid
grid.Close()
End Sub
VB 6 Usage
Sub CellToProj(Column As Long, Row As Long, ByRef x As Double, ByRef y As Double)
Parameters
|
Column | The column of the cell to find the center in projected map coordinates. |
| Row | The row of the cell to find the center in projected map coordinates. |
| x | Reference parameter. Returns the x projected map coordinate of the center of the specified cell. |
| y | Reference parameter. Returns the yprojected map coordinate of the center of the specified cell. |
Sample Code
Private Sub CellToProj()
Dim grid As New MapWinGIS.grid
Dim x As Double, y As Double
'Open a grid from disk
grid.Open ("C:\grid.asc")
'Get the center of the cell in projected map coordinates stored in x and y
grid.CellToProj 5, 5, x, y
'Display center of the cell in message box
MsgBox ("The center of cell col 5, row 5: x = " + Str(x) + " y = " + Str(y))
'Close the grid
grid.Close
End Sub
















