(the most simple, assuming tif image is only one page, change its width and height)
Var
Tags: TIETIFFHandler;
SImgFileName: String;
The begin
Tags:=TIETIFFHandler. Create;
SImgFileName:='F: \ 200. Tif';
Tags. ReadFile (sImgFileName);
Tags. The SetValue (0, 256, ttLong, 2048);
Tags. The SetValue (0, 257, ttLong, 2418);
Tags. The WriteFile (sImgFileName);
end;
The code is simple, and can change the properties implementation purposes, from (1728196) is modified to 8 (2048241), but the problem is that, after I modify success and save, then play the tif image, part in the picture on the right side of the black area, feeling that with the increase of the width size , on the left is the original image content, this is how to return a responsibility? Need to how to fix it?
Hope your help!
CodePudding user response:
Attributes are changed, although the enlarged image area, the image should also corresponding amplification, it is best, first converted to a bitmap, enlarged, and then back to tif,CodePudding user response:
Problem complement:There is also a situation, after I modify the width and save, tif image become garbled and black, what reason is this?