How do I save the JPG format options like Photoshop?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.