How do I save the JPG format options like Photoshop? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061019114413224.html
I do not know
Accidentally discover your own Code The saved JPG is of inferior quality to PS
The Load Code is as follows: [loadin is the complete file name]
Loadinbmp: = tbitmap. Create;
If (lowercase (extractfileext (loadin) = '.jpeg ') or (lowercase (extractfileext (loadin) = '.jpg') then
Begin
JPG: = tsf-image. Create;
JPG. loadfromfile (loadin );
Loadinbmp. Assign (JPG );
JPG. Free;
End;
If lowercase (extractfileext (loadin) = '.png 'then
Begin
PNG: = tpngobject. Create;
PNG. loadfromfile (loadin );
Loadinbmp. Width: = PNG. width;
Loadinbmp. Height: = PNG. height;
Loadinbmp. Assign (PNG );
PNG. Free;
End;
If lowercase (extractfileext (loadin) = '.bmp 'then
Begin
Loadinbmp. loadfromfile (loadin );
End;
Imageview. Width: = loadinbmp. width;
Imageview. Height: = loadinbmp. height;
Imageview. Picture. Assign (loadinbmp );
Save the JPG Code as follows: [FN is the complete file name]
JPG: = tsf-image. Create;
JPG. Assign (imageview. Picture. Bitmap );
JPG. compressionhigh-quality: = 100;
JPG. Performance: = jpbestquality;
JPG. Compress;
JPG. savetofile (FN );
JPG. Free;
The figure I tried is as follows:
Add the "sample picture" bold red characters to the top left corner of a JPG file.
The surrounding outlines of words stored in PS are clear
Then use your own Program Loading is clearly displayed on the image.
You can save the file to find that the remaining part of the file is better than the font.
You can also use PS to open the saved JPG file and save it as JPG, but it is still clear.
Then I tried to find out
JPG: = tsf-image. Create;
JPG. loadfromfile (loadin );
JPG. savetofile (tempjpgfile );
The effect of direct storage during loading is clear.
After converting to BMP, the image is displayed clearly.
Only BMP is saved as JPG.
In the JPG example provided by D7, no code is saved for the JPG file.
In addition, the saved options in PS are quite informative and I don't know how to implement them.
No such information can be found on the Internet.
Thank you!
.'
'
Tsf-image. compressionquality/grayscale/prograssiveencoding and so on.
Mark
Follow