I am using Geomedia. I want create jpg image of the map. How can it be done using vb.net?


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
        End With

        ' Create recordset of States
        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


    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        clp = CreateObject("GeoMedia.ClipBoardService")

    End Sub
End Class
| improve this answer | |
  • 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! – whuber Nov 30 '12 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")

| improve this answer | |
  • 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. – Devdatta Tengshe Jun 26 '13 at 8:17
  • sorry...i am a nobie :( – Marrisa Zhang Jun 27 '13 at 3:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.