HOW TO
The Output Image Quality (OIQ) setting is used to control the resampling of raster elements when outputting a map.This setting can be controlled programatically, but the user must ensure that it is set for each data frame in the document.
Use the code snippet below:
Code:
Private Sub ResetOutputQualityToBest()
On Error GoTo EH
Dim pActiveView As IActiveView
Dim pDisplayTrans As IOutputRasterSettings
Dim pMxDoc as IMxDocument
Set pMxDoc = ThisDocument
' This will change the setting in the 'File | Page Setup' dialog,
' but does not affect each map until the document is reopened...
Set pActiveView = pMxDoc.PageLayout
Set pDisplayTrans = pActiveView.ScreenDisplay.DisplayTransformation
If pDisplayTrans.ResampleRatio <> esriRasterOutputBest Then
pDisplayTrans.ResampleRatio = esriRasterOutputBest
End If
' ...so we will additionally set the output quality for each map so
' the current export works correctly.
Dim pMaps As IMaps
Set pMaps = pMxDoc.Maps
Dim lMapIndex As Long
For lMapIndex = 0 To (pMaps.Count - 1)
Set pActiveView = pMaps.Item(lMapIndex)
Set pDisplayTrans = pActiveView.ScreenDisplay.DisplayTransformation
If pDisplayTrans.ResampleRatio <> esriRasterOutputBest Then
pDisplayTrans.ResampleRatio = esriRasterOutputBest
End If
Next lMapIndex
Exit Sub
EH:
Err.Raise Err.Number, "MapsOnDemand.ResetOutputQualityToBest", Err.Description
End Sub
Code:
tagesriResampleRatioType
1 - esriRasterOutputBest
3 - esriRasterOutputNormal
5 - esriRasterOutputDraft
Article ID:000003308
Get help from ArcGIS experts
Download the Esri Support App