I have another problem. If i save the image in the size of the map control everything is ok, but i dont want that the printing area to depend on the size of the map control. I use the following code to do the print to file
Dim widthArea As Integer = 725
Dim heightArea As Integer = 500
Dim bitmap As New Bitmap(widthArea, heightArea)
-> to print the map in the screen i use Dim bitmap as new bitmap(cint(map.width),cint(map.height))
For Each layeroverlay As LayerOverlay In map.Overlays
Dim point As PointShape = map.CurrentExtent.GetCenterPoint
Dim oRect As RectangleShape = New RectangleShape((point.X - widthArea / 2), (point.Y + heightArea / 2), (point.X + widthArea / 2), (point.Y - heightArea / 2))
-> to print the map in the screen i use Dim oRect RectangleShape = map.currentextent
For Each layer As Layer In layeroverlay.Layers
printerGeoCanvas.BeginDrawing(bitmap, oRect, GeographyUnit.DecimalDegree)
layer.Open()
layer.Draw(printerGeoCanvas, labelsInLayers)
layer.Close()
printerGeoCanvas.EndDrawing()
Next
Next
i need an image with the size w=720 and h=500 with the feature i need in the center of the image, not the current extent of the map to be printed