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();