Richard.Ma 发表于 2020-12-29 17:05
请直接将代码复制上来,拍照的这个图片根本看不清楚代码,
另外,请将转换前的图片上传上来
这个是写的代码。文件的话暂时没在身边,就是一个tif文件使用画板画上颜色,其中有些字花了彩色的,比如黄色,绿色的文字。
Private SubButton2_Click(sender As Object, e As EventArgs) Handles Button2.Click
wrkFilePath = D:xxxtempTifFile 1.tif
tmpwrkFilePath=D:xxx1tempTifFile0.tif"
Dim DitherMethod As Leadtools.RasterDitheringMethod = Leadtools.RasterDefaults .DitheringMethod
Leadtools.RasterDefaults.DitheringMethod = Leadtools.RasterDitheringMet hod .None
Dim WorkImage As LDT.RasterImage = codecs.Load(tmpwrkFilePath,1,Leadtools.Codecs.CodecsLoadByteOrder.BgrOrGray,1,-1)Leadtools.RasterDefaults.DitheringMethod = DitherMethod
codecs.Save(WorkImage, wrkFilePath, Leadtools.RasterImageFormat.CcittGroup4,1,1, 1, 1, LDTC.CodecsSavePagelMode.Overgrite) Image = WorkImage
rivSlip.Image = Image
rivSlip.InteractiveMode =Leadtools. inForms.RasterViewerInteract iveMode.Pan
rivSlip.HorizontalAlignMode = Leadtools.RasterPaintAlignMode .Center
rivSlip.EnableScro|lingInterface = True
Dim defaultZoon As Integer = Integer.Parse(30)
Dim wZoom As Integer = defaultZoom
Me.rivSlip.ScaleFactor =wZoom /100
End Sub
|