MapImage.MimeData Property
Contains the map image (MimeData object), which includes the image type, the MIME label, and the binary image.
Public Dim MimeData As [Namespace].MimeData
Member of [Namespace].MapImage
[C#]
public [Namespace].MimeData MimeData
Member of [Namespace].MapImage
Remarks
- The MimeData property is null if the MapOptions.ReturnType property is set to ReturnSecureUrl or ReturnUrl (MapReturnType enumeration).
Example
[Visual Basic]
'This example assumes that the service instance
''renderService' has already been created and that
'the MapPoint Web Service namespace has been imported
'Get a map
Dim myViews(0) As ViewByScale
myViews(0) = New ViewByScale()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).MapScale = 5000
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)
'Render the image in a PictureBox control
Dim PictureBox1 As New System.Windows.Forms.PictureBox()
PictureBox1.Image = New System.Drawing.Bitmap(New System.IO.MemoryStream(mapImages(0).MimeData.Bits))
[C#]
//This example assumes that the service instance
//'renderService' has already been created and that
//the MapPoint Web Service namespace has been imported
//Get a map
ViewByScale[] myViews = new ViewByScale[1];
myViews[0] = new ViewByScale();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].MapScale = 5000;
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
MapImage[] mapImages;
mapImages = renderService.GetMap(mapSpec);
//Render the image in a pictureBox control
System.Windows.Forms.PictureBox pictureBox1 = new System.Windows.Forms.PictureBox();
pictureBox1.Image = new System.Drawing.Bitmap(new System.IO.MemoryStream(mapImages[0].MimeData.Bits));
See Also
MapImage Class | MimeData Class | MapOptions.ReturnType Property | MapReturnType Enumeration