Solved

Converting bmp to jpeg

Posted on 2000-02-19
3
313 Views
Last Modified: 2013-11-19
Is it possible to convert a bmp to a jpeg with delphi?  If so, can I have some code please.

I'm new to delphi so please be gentle (I need a descriptive answer).  I've been using vb for some time, but I find it lacking in some areas.  So far, from what I've seen delphi kicks butt.  The problem of course is, I don't know how to code in delphi-pascel.
0
Comment
Question by:fibdev
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 2538816
Hi Fibdrv,
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 ;-)


here is examaple from above page :

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 

Regards Barry


0
 
LVL 3

Author Comment

by:fibdev
ID: 2538878
I found the answer to this in the help files, but it would not be in good form to deny you the points.

Thank you
0
 
LVL 17

Expert Comment

by:inthe
ID: 2538922
cheers :-)

ps.
dont forget to look at the efg site it really good for graphics and files stuff.
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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this second Micro Tutorial in the series,  viewers will learn more basic shortcuts and functions of Illustrator. In this tutorial you will learn about the eyedropper tool, zoom , ellipses and more.
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"…

685 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