Solved

Graphic file conversion

Posted on 2000-02-16
6
137 Views
Last Modified: 2013-11-19
Please, I need to know how to convert a .BMP file to a .JPG whithout calling an external conversion program (from within my application). In case I have to get any .DLL or code unit, please let me know where to find it.

Thanks a lot.
0
Comment
Question by:andres_de_marco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 2527993
Hi,
there is example about half way down this page:

http://www.efg2.com/lab/library/delphi/graphics/FileFormatsAndConversion.htm#Conversions

+ many other useful conversions also ;-)

Regards Barry
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2528053
Try this:


uses JPEG;

procedure TForm1.Button2Click(Sender: TObject);
var p: TPicture;
    j: TJPEGImage;
begin
  p := TPicture.Create;
  p.LoadFromFile('spider.bmp');
  j := TJPEGImage.Create;
  j.Assign(p.Graphic);
  j.SaveToFile('spider.jpg');
  j.Free;
  p.Free;
end;
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2528221
listenning
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:Epsylon
ID: 2533206
Are you still there?
0
 
LVL 17

Expert Comment

by:inthe
ID: 2533873
from page i referenced in forst comment:
PROCEDURE ConvertBMPtoJPG (CONST BMPName: STRING; JPGName: STRING);
  VAR
    Bitmap: TBitmap;
    JPEG : TJPEGImage;
BEGIN
  Bitmap := TBitmap.Create;
  JPEG := TJPEGImage.Create;
  TRY
    Bitmap.LoadFromFile(BMPName);
    JPEG.CompressionQuality := 80;
    JPEG.Assign(Bitmap);
    JPEG.SaveToFile(JPGName);
  FINALLY
    Bitmap.Free;
    JPEG.Free
  END
END {ConvertBMPtoJPG};  

Converting a BMP to a JPEG and Vice Versa (TI4528D)
http://www.borland.com/devsupport/delphi/ti/TI4528D.html

http://www.efg2.com/lab/Graphics/BMPJPG.htm
efg's BMPJPG Lab Report. Interactively convert BMPs to JPGs or vice versa. Nearly all the JPEG compession options cn be controlled via the user interface, including image quality and progressive encoding and display.

efg's Command-line utility for batch conversion of BMPs to JPGs: BMPtoJPG.PAS
http://www.efg2.com/lab/library/delphi/graphics/BMPtoJPG.PAS.txt
0
 

Author Comment

by:andres_de_marco
ID: 2534770
I´ve been out on a short journey for the past two day so I didn´t have any time to respond to your posted messages. This thing really works so I have to THANK YOU A LOT !!!!

Best regards from Argentina

Andrés De Marco
andres_de_marco@hotmail.com
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…
Learn how to use the remote presentation tool in Prezi to allow you to harness the power of this cloud based presentation platform. You can show your presentation with a remote audience using this free tool.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question