I am using Geomedia. I want create jpg image of the map. How can it be done using vb.net?
2 Answers
ClipboardService Example
Option Explicit On
Imports PView = Intergraph.GeoMedia.PView
Imports PClient = Intergraph.GeoMedia.PClient
Imports PCSS = Intergraph.GeoMedia.PCSS
Imports GDO = Intergraph.GeoMedia.GDO
Public Class Form1
Dim objLE As PView.LegendEntry, objConn As New PClient.Connection
Dim objOPipe As PClient.OriginatingPipe, objRS As GDO.GRecordset
Dim clp As PClient.ClipboardService
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Set Map View parameters
With GMMapView1
.CoordSystemsMgr = New PCSS.CoordSystemsMgr
.CoordSystemsMgr.CoordSystem.BaseStorageType = PCSS.CSBaseStorageConstants.csbsGeographic
.Legend = New PView.Legend
.BackgroundColor = RGB(255, 255, 255)
End With
' Create connection
With objConn
.Location = "C:\Warehouses\USSampleData.mdb"
.Mode = PClient.ConnectionConstants.gmcModeReadOnly
.Type = "Access.GDatabase"
.Name = "Connect1"
.CoordSystemsMgr = GMMapView1.CoordSystemsMgr
.Connect()
End With
' Create recordset of States
objConn.CreateOriginatingPipe(objOPipe)
objOPipe.Table = "States"
objRS = objOPipe.OutputRecordset
' Create legend entry for states
objLE = CreateObject("Geomedia.LegendEntry")
Dim objstyleservice As New PView.StyleService
Dim objStyle As PView.StyleDefinition = Nothing
objstyleservice.GetStyle("Area Style", objStyle)
' Set legend entry characteristics
With objLE
.GeometryFieldName = "Geometry"
.InputRecordset = objRS
.Style = objStyle
End With
GMMapView1.Legend.LegendEntries.Append(objLE)
objLE.LoadData()
GMMapView1.Fit()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
clp = CreateObject("GeoMedia.ClipBoardService")
clp.SnapShot(GMMapView1.Dispatch)
End Sub
End Class
-
Welcome to our site! Could you please (1) explain how this answers the question (I do not see how this example creates any jpeg files) and (2) give proper attribution to the code, if significant parts of it were not originally written by you. Thank you!– whuberNov 30, 2012 at 13:17
i have no touch with the Geomedia, but for creating image using VB.NET, the code should be almost the same. just write the code i know for you, hope it helps.
Dim Image As New RasterEdgeImaging()
Dim ResImg As Integer ResImg = RasterEdgeImaging.CreateBitmapImage(75, 250, PixelFormat.Format24bppRgb, RasterEdgeImaging.ARGB(255, 0, 0, 0)) Image.save("C:\1.bmp")
-
I'm not sure how this answers the OP's question. The library you have linked to is a generic Image processing library, and has nothing to do with Geomedia. Jun 26, 2013 at 8:17
-