| | |
| | | ShowText := _Msg('檔案加入中,請稍候(' + inttostr(i) + '/' + inttostr(P) + ')'); |
| | | DataLoading(True, True); |
| | | ISB.LoadFromFile(FName, i); |
| | | // ISB.SaveToFile('C:\OCX\aaaaaa'+IntToStr(i)+'.tif'); |
| | | DeskewImg(ISB.Graphic); |
| | | // ISB.SaveToFile('C:\OCX\bbbbbb'+IntToStr(i)+'.tif'); |
| | | |
| | | |
| | | ISB_BW.Graphic.Assign(ISB.Graphic); //20180104 |
| | | If ISB.Graphic.ImageFormat <> ifBlackWhite Then //20180104 |
| | | begin |
| | | ConvertToBW(ISB_BW.Graphic); |
| | | end; |
| | | ///ISB_BW.SaveToFile('KKKKKKKK.tif'); |
| | | |
| | | iGraphic_First := TTiffGraphic.Create; |
| | | iGraphic_sec := TTiffGraphic.Create; |
| | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | //ShowMessage(IntToStr(iGraphic_First.Palette.palNumEntries)); //彩色 會為0 黑白 為2 |
| | | |
| | | MpsGetBarcode(ISB.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | //有必要的話先把影像轉正 再開始切圖 |
| | | If CheckNeedCrop(iGraphic_First) Then |
| | | Begin |
| | |
| | | (TreeView1.Selected = MyTreeNode1) Then |
| | | Begin |
| | | SaveFilename := ''; |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | ISB_BW.Graphic.Assign(iGraphic); //20180104 |
| | | If iGraphic.ImageFormat <> ifBlackWhite Then //20180104 |
| | | begin |
| | | ConvertToBW(ISB_BW.Graphic); |
| | | end; |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | //ShowMessage(IntToStr(MpsBarcodeinf.Count)); |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | |
| | | End; |
| | | End; |
| | | FormID := BarCode2FormID; |
| | | //ShowMessage('FormID='+FormID); |
| | | // 取出FormID |
| | | SaveFilename := FormID; |
| | | If (TreeView1.Selected = NewTreeNode) Then |
| | |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | if iGraphic.Palette.palNumEntries = 0 then //20171130 彩色 會為0 黑白 為2 |
| | | //ShowMessage(IntToStr(iGraphic.Palette.palNumEntries)); |
| | | if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then //20171130 彩色 會為0 黑白 為2 灰階256 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | |
| | | // SaveStream.Free; |
| | | End; |
| | | End; |
| | | |
| | | // Rotate(ISB.Graphic,MpsBarcodeinf.r180[n]); //20170705 加入有條碼就轉正 |
| | | // ISB.SaveToFile(SavePath+SaveFilename); |
| | | |
| | | SetContextList('A', -1, CaseID, DocDir, SaveFilename); |
| | | If (TreeView1.Selected = NewTreeNode) Then |
| | |
| | | Break; |
| | | End; |
| | | End; |
| | | // Rotate(ISB.Graphic,MpsBarcodeinf.r180[n]); //20170705 加入有條碼就轉正 |
| | | if iGraphic.Palette.palNumEntries = 0 then //20171130 彩色 會為0 黑白 為2 |
| | | |
| | | if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then //20171130 彩色 會為0 黑白 為2 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | |
| | | end; |
| | | pScanInfo^.Graphic.Compression := tcJpeg; |
| | | pScanInfo^.Graphic.JpegQuality := FJpgCompression; |
| | | //ShowMessage(IntToStr(pScanInfo^.Graphic.JpegQuality)); |
| | | //if pScanInfo^.Graphic.Compression = tcJpeg then |
| | | //begin |
| | | //ShowMessage('jpg'); |
| | | //end; |
| | | |
| | | end |
| | | else |
| | | begin |
| | |
| | | //iGraphic.Assign(iGraphic_First); |
| | | iGraphic := iGraphic_First; |
| | | |
| | | |
| | | if iGraphic.ImageFormat=ifGray256 then //20180104 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | if iGraphic.ImageFormat=ifTrueColor then //20180104 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | |
| | | |
| | | while not iGraphic.IsEmpty do |
| | |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | if iGraphic.ImageFormat=ifGray256 then //20180104 因此旋轉後變為回packbits 所以要改為jpeg |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | if iGraphic.ImageFormat=ifTrueColor then |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | |
| | | PageEnd; |
| | | IF PEFileName <> '' Then |
| | | begin |