Leadtools.Mrc Namespace > MrcSegmenter Class : SaveImageT44 Method |
public void SaveImageT44( RasterImage image, string fileName, MrcT44ImageFormat format, MrcCompressionOptions options, RasterCodecs codecs )
'Declaration Public Sub SaveImageT44( _ ByVal image As RasterImage, _ ByVal fileName As String, _ ByVal format As MrcT44ImageFormat, _ ByVal options As MrcCompressionOptions, _ ByVal codecs As RasterCodecs _ )
'Usage Dim instance As MrcSegmenter Dim image As RasterImage Dim fileName As String Dim format As MrcT44ImageFormat Dim options As MrcCompressionOptions Dim codecs As RasterCodecs instance.SaveImageT44(image, fileName, format, options, codecs)
public void SaveImageT44( RasterImage image, string fileName, MrcT44ImageFormat format, MrcCompressionOptions options, RasterCodecs codecs )
public: void SaveImageT44( RasterImage^ image, String^ fileName, MrcT44ImageFormat format, MrcCompressionOptions options, RasterCodecs^ codecs )
Public Sub SaveImageT44Example() ' Load an image Dim codecs As RasterCodecs = New RasterCodecs() codecs.ThrowExceptionsOnInvalidImages = True Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "MRCSegmentation.mrc")) Dim segmenter As MrcSegmenter = New MrcSegmenter(image, Path.Combine(LEAD_VARS.ImagesDir, "MRCSegmentation.sgm")) Dim compressionOptions As MrcCompressionOptions = New MrcCompressionOptions() compressionOptions.MaskCoder = MrcMaskCompression.FaxG31D compressionOptions.PictureCoder = MrcPictureCompression.Jpeg compressionOptions.PictureQualityFactor = 10 Try segmenter.SaveImageT44(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.Mrc"), MrcT44ImageFormat.MrcT44, compressionOptions, codecs) Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
public void SaveImageT44Example() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"MRCSegmentation.mrc")); MrcSegmenter segmenter = new MrcSegmenter(image,Path.Combine(LEAD_VARS.ImagesDir,"MRCSegmentation.sgm")); MrcCompressionOptions compressionOptions = new MrcCompressionOptions(); compressionOptions.MaskCoder = MrcMaskCompression.FaxG31D; compressionOptions.PictureCoder = MrcPictureCompression.Jpeg; compressionOptions.PictureQualityFactor = 10; try { segmenter.SaveImageT44(image,Path.Combine(LEAD_VARS.ImagesDir,"Out_Result.Mrc"), MrcT44ImageFormat.MrcT44, compressionOptions, codecs); } catch(Exception ex) { MessageBox.Show(ex.Message); } } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2