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: