bright91

export to jpg in arcscene

Discussion created by bright91 on Sep 29, 2010
Hi all,

I have a vba code exporting ActiveVeiw to a jep file in ArcMap and it worked fine. I would like to do this same job in ArcScene. Can anyone help me? Here's the ArcMap vba code. Thank you in advance, Justin.

Public Sub export2Maps()
    Dim pMxDoc As IMxDocument
    Dim pActiveView As IActiveView
    Dim pExport As IExport
    Dim pPixelBoundsEnv As IEnvelope
    Dim exportRECT As tagRECT
    Dim iOutputResolution As Integer
    Dim iScreenResolution As Integer
    Dim hDC As Long
   
    Set pMxDoc = ThisDocument
    Set pActiveView = pMxDoc.ActiveView
    Set pExport = New ExportJPEG
   
    pExport.ExportFileName = "d:\ExportMap." & Right(pExport.Filter, 3)
    iScreenResolution = 96  'default screen resolution is usually 96dpi
    iOutputResolution = 96
    pExport.Resolution = iOutputResolution
   
    With exportRECT
    .Left = 0
    .Top = 0
    .Right = pActiveView.ExportFrame.Right * (iOutputResolution / iScreenResolution)
    .bottom = pActiveView.ExportFrame.bottom * (iOutputResolution / iScreenResolution)
    End With
   
    Set pPixelBoundsEnv = New Envelope
    pPixelBoundsEnv.PutCoords exportRECT.Left, exportRECT.Top, exportRECT.Right, exportRECT.bottom
    pExport.PixelBounds = pPixelBoundsEnv
   
    hDC = pExport.StartExporting
    pActiveView.Output hDC, pExport.Resolution, exportRECT, Nothing, Nothing
    pExport.FinishExporting
    pExport.Cleanup
End Sub

Outcomes