Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
add comment

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
share|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
add comment

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")

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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