Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Graphic file conversion

Posted on 2000-02-16
6
Medium Priority
?
149 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In addition to being a great web-based presentation tool, Prezi also makes it easy to save your presentation as a PDF to share with others as well. Learn how in this tutorial. Select the share icon from the top menu in your Prezi editor: Select "D…
Suggested Courses

604 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