SetMRCPreserveSmoothing Method (GdPicturePDF)
Enables the use of enhanced smoothing technique when processing the image compression by the MRC engine, for example using the
GdPicturePDF.AddImageFromGdPictureImage method.
Smoothing improves the contrast of the image by reducing noise. That means the produced image is less pixelated, but it's file size can increase. The predefined value is true.
public void SetMRCPreserveSmoothing(
bool
)
public procedure SetMRCPreserveSmoothing(
: Boolean
);
public function SetMRCPreserveSmoothing(
: boolean
);
public: void SetMRCPreserveSmoothing(
bool
)
public:
void SetMRCPreserveSmoothing(
bool
)
'Declaration
Public Sub SetMRCPreserveSmoothing( _
ByVal As Boolean _
)
Parameters
- PreserveSmoothing
- Set this parameter to false to dramatically reduce produced file size,
but get a less contrasting text. Otherwise set it to true.
How to affect properties of the resulting image compressed using the MRC engine.
Dim caption As String = "Example: SetMRCPreserveSmoothing"
Dim gdpictureImaging As GdPictureImaging = New GdPictureImaging()
Dim imageID As Integer = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg")
If gdpictureImaging.GetStat() = GdPictureStatus.OK Then
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If gdpicturePDF.NewPDF() = GdPictureStatus.OK Then
gdpicturePDF.SetMRCImageBackgroundResolution(100)
gdpicturePDF.SetMRCPreserveSmoothing(True)
If gdpicturePDF.AddImageFromGdPictureImage(imageID, PdfAdvancedImageCompression.PdfAdvancedImageCompressionMRC) = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("image.pdf", True) = GdPictureStatus.OK Then
MessageBox.Show("The image has been added successfully and the file has been saved.", caption)
Else
MessageBox.Show("The CreateGdPictureImageFromFile() method has failed with the status: " + gdpictureImaging.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The AddImageFromGdPictureImage() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The NewPDF() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
gdpicturePDF.Dispose()
Else
MessageBox.Show("The CreateGdPictureImageFromFile() method has failed with the status: " + gdpictureImaging.GetStat().ToString(), caption)
End If
gdpictureImaging.ReleaseGdPictureImage(imageID)
gdpictureImaging.Dispose()
string caption = "Example: SetMRCPreserveSmoothing";
GdPictureImaging gdpictureImaging = new GdPictureImaging();
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg");
if (gdpictureImaging.GetStat() == GdPictureStatus.OK)
{
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.NewPDF() == GdPictureStatus.OK)
{
gdpicturePDF.SetMRCImageBackgroundResolution(100);
gdpicturePDF.SetMRCPreserveSmoothing(true);
if (gdpicturePDF.AddImageFromGdPictureImage(imageID, PdfAdvancedImageCompression.PdfAdvancedImageCompressionMRC) == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("image.pdf", true) == GdPictureStatus.OK)
MessageBox.Show("The image has been added successfully and the file has been saved.", caption);
else
MessageBox.Show("The CreateGdPictureImageFromFile() method has failed with the status: " + gdpictureImaging.GetStat().ToString(), caption);
}
else
MessageBox.Show("The AddImageFromGdPictureImage() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The NewPDF() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
gdpicturePDF.Dispose();
}
else
MessageBox.Show("The CreateGdPictureImageFromFile() method has failed with the status: " + gdpictureImaging.GetStat().ToString(), caption);
gdpictureImaging.ReleaseGdPictureImage(imageID);
gdpictureImaging.Dispose();