Home > Back-end >  Modify the tif file attribute value, the project need, everybody to help, thanks! Thank you! Thank y
Modify the tif file attribute value, the project need, everybody to help, thanks! Thank you! Thank y

Time:10-02

I want to modify a tif image attributes: width, height (single to: pixels), and horizontal resolution, mainly is the three attributes, I installed the third-party controls ImageEN, able to read and modify the properties of the tif image, my implementation code is as follows (Delphi7) :
(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?
  • Related