Home > Back-end >  ImageEn save TIF, file cannot view
ImageEn save TIF, file cannot view

Time:10-06

Use ImageEn will scan the file save as TIF format, originally due to save the file SIZE is too large (more than 20 m), then the original ImageEnMView1. Benefiting. SaveToFile (FileName) method, instead ImageEnMView1. Benefiting. SaveToFileTIFF (FileName), so file decreased significantly, just controlled K, at the same time the use of Microsoft Office Document Imaging can open to see, but cannot see with other image software, including the image browser window (Windows Picture and Fax Viewer) but can't see, the problem must still out in the preservation, because the original ImageEnMView1. Benefiting. SaveToFile (FileName) while saving is very big, but at least all kinds of software can open view.

Masters help have a look at ah, is the ultimate goal is to save the file, the software can view, save the file code is as follows:
The function TSTSImageControl. Save (const FileName: WideString) : WordBool;
Var
I: integer;
The begin
Result:=false;
Try

ScannerSet.Com pressionType:=4;

SaveImageBitmap;
For I:=0 to ImageEnMView1. Benefiting. Do ParamsCount - 1
The begin
If uppercase (ExtractFileExt (FileName))='TIF' then
The begin
Case pressionType of ScannerSet.Com
0: ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_CCITT1D;
1: ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_G3FAX1D;
2: ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_G3FAX2D;
3: ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_G4FAX;
4: ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_JPEG;
The else
ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_JPEG;
end;

End the else
The begin
ImageEnMView1. Benefiting. Params [I] TIFF_Compression:=ioTIFF_JPEG;
//ImageEnMView1. Benefiting. Params [I] TIFF_JPEGQuality:=ScannerSet. JPEGQuality;
end;
ImageEnMView1. Benefiting. Params [I] DpiX:=ScannerSet. XImageResolution;
ImageEnMView1. Benefiting. Params [I] DpiY:=ScannerSet. YImageResolution;

If (ImageEnMView1. Benefiting. Params [I] DpiX> 0) and (ImageEnMView1. Benefiting. Params [I] DpiY> 0) then
The begin
ImageEnMView1. Benefiting. Params [I]. Width:=
Round (ImageEnMView1. Benefiting. Params [I] DpiX * self ScannerSet. ImageWidth * Const_InchCm);
ImageEnMView1. Benefiting. Params [I]. Height:=
Round (ImageEnMView1. Benefiting. Params [I] DpiY * self ScannerSet. ImageHeight * Const_InchCm);
End the else
The begin
ImageEnMView1. Benefiting. Params [I] DpiX:=400;
ImageEnMView1. Benefiting. Params [I] DpiY:=400;
ImageEnMView1. Benefiting. Params [I]. Width:=
Round (400 * self. ScannerSet. ImageWidth * Const_InchCm);
ImageEnMView1. Benefiting. Params [I]. Height:=
Round (400 * self. ScannerSet. ImageHeight * Const_InchCm);
end;
end;
ImageEnMView1. Benefiting from. Update;
//ImageEnMView1. Benefiting. SaveToFile (FileName);
ImageEnmview1. Benefiting. SaveToFileTIFF (FileName);
Except,
exit;
end;
Result:=true;
end;

CodePudding user response:

Try using GID + is saved as a TIFF,,,

CodePudding user response:

reference 1st floor lqfcu2 response:
using the GID + is saved as a TIFF try,,,


Specific code can be help me to write it, in fact I never contact the Delphi, just do this colleague quit, because, by that I do take a look at the B/S, just very not easy to adjust to compile, as for the specific code, hope ace to help me to write, compile I see, thank you!

CodePudding user response:

Does anyone help

CodePudding user response:

Indeed, this don't know what to change the parameters to ideal

CodePudding user response:

Choose JPG compression format
  • Related