Solved

Graphic file conversion

Posted on 2000-02-16
6
134 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adobe CS6 - update re-activation Mac os x 7 47
delphi exception 7 62
Unique identifier on a terminal server (rdp) 4 46
Graphics32 under Delphi 10.1 Berlin 2 37
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now