Solved

Graphic file conversion

Posted on 2000-02-16
6
133 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Learn how to set up basic frames and paths in Prezi and understand the open space that Prezi allows you to create presentations in.
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…

746 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

9 Experts available now in Live!

Get 1:1 Help Now