'======================================================= ' ExportToJpeg '======================================================= Public Sub ExportToJeg(height, width, filename) Dim exportRECT As tagRECT Dim hDC As Long Dim scl, scalex, scaley Set this.a.IActiveView = this.a.IMxDocument.ActiveView Set this.a.IExport = New ExportJPEG Set this.a.IPrinter = this.a.IMxApplication.Printer Set this.a.IPaper = this.a.IPrinter.Paper Set this.a.IPageLayout = this.a.IMxDocument.PageLayout this.a.IExport.ExportFileName = filename this.a.IExport.Resolution = 1 scalex = width / this.a.IActiveView.ScreenDisplay.ClipEnvelope.width scaley = height / this.a.IActiveView.ScreenDisplay.ClipEnvelope.height scl = scalex If (scaley > scl) Then scl = scaley exportRECT.Left = 0 exportRECT.Top = 0 exportRECT.Right = this.a.IActiveView.ScreenDisplay.ClipEnvelope.width * scl exportRECT.bottom = this.a.IActiveView.ScreenDisplay.ClipEnvelope.height * scl h = this.a.IActiveView.ScreenDisplay.ClipEnvelope.height * scl w = this.a.IActiveView.ScreenDisplay.ClipEnvelope.width * scl Set this.a.IEnvelope = New Envelope this.a.IEnvelope.PutCoords exportRECT.Left, exportRECT.Top, exportRECT.Right, exportRECT.bottom this.a.IExport.PixelBounds = this.a.IEnvelope hDC = this.a.IExport.StartExporting this.a.IActiveView.Output hDC, this.a.IExport.Resolution, exportRECT, Nothing, Nothing '--------------------- Draw Polygon ---------- Set this.a.IScreenDisplay = this.a.IActiveView.ScreenDisplay Set this.a.IFillSymbol = New simpleFillSymbol this.a.IFillSymbol.Color = this.Color.Esri("Tomato") this.a.IScreenDisplay.StartDrawing hDC, esriNoScreenCache this.a.IScreenDisplay.SetSymbol this.a.IFillSymbol this.a.IScreenDisplay.drawPolygon getPolygon(200, 200) '--------------------- Draw Polygon ---------- this.a.IScreenDisplay.FinishDrawing this.a.IExport.FinishExporting this.a.IExport.Cleanup End Sub