How can I convert a BMP file to a JPG file? How can I convert it to a JPG file in Delphi?

Source: Internet
Author: User
 

How can I convert a BMP file to a JPG file? How can I convert it to a JPG file in Delphi?

Answer questions from netizens:
========================================================== =========================================> 〉
: How can I convert a BMP file to a JPG file? How can I convert it to a JPG file in Delphi?
: JPG file?
:
<======================================================== ======================================
This user, if you use delphi4, notices that its timage supports the format of *. jpg, *. JPEG, *. BMP, *. ICO ...... This problem will be well solved!
The source code is as follows:
<<
Procedure tform1.button1click (Sender: tobject );
(* Compression of BNS is JPEG, but the compression ratio is not available.
Try it out. About 1/3 ^ _ ^:
Note: JPEG to uses must be added.
*)
VaR
Myjpeg: tsf-image;
Mybmp: tbitmap;
Begin
Mybmp: = tbitmap. Create;
With mybmp do
Try
Loadfromfile ('e:/lm. BMP '); // your image location
Myjpeg: = tsf-image. Create;
With myjpeg do begin
Assign (mybmp );
Compressionquality: = 10; // compression ratio
Compress;
Savetofile ('e:/lm01.jpeg '); // save path ......
Free;
End;
Finally
Free;
End;
End;

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.