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
Solved

Saving jpeg as bitmap

Posted on 1999-01-13
15
545 Views
Last Modified: 2013-11-19
How do i save a bitmap as a jpeg, using a TImage.
0
Comment
Question by:WarheaD
  • 6
  • 5
  • 3
  • +1
15 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 1356272
hi
try this:
image1.picture.savetofile('c:\bmpasjpg.jpg');

Regards Barry
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1356273
Barry: That is correct but Warhead will need to add teh jpeg unit from the D4 CD (in the info\Extras\jpeg directory on the CD)

Cheers,

Raymond.
0
 
LVL 17

Expert Comment

by:inthe
ID: 1356274
hi
Raymond i just did this in d4(no jpg components) and it worked fine how come you have to add jpg unit ?
Regards Barry
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:WarheaD
ID: 1356275
hi

i've already got the jpeg stuff in my delphi, but i dont have delphi on this machine so i'll get back later.

thanx
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1356276
Barry: The jpeg code is not included in the TImage components by default (its pretty chunky and adds some 150k to your app). Try loading the .JPG files into TImage and see what happens.

Did it produce a JPEG file, or a BMP file with a JPG extension?

Raymond.
0
 
LVL 17

Expert Comment

by:inthe
ID: 1356277
Sorry raymond you right without jpg it produce bmp with jpg extension
Regards Barry
0
 

Author Comment

by:WarheaD
ID: 1356278
I'm back (a week later)

I have included the jpeg.dcu into my uses, but i still get a bitmap with jpeg extension.
When I do it the other way round( i.e jpeg to bitmap), i get a jpeg with bitmap extension.


0
 

Author Comment

by:WarheaD
ID: 1356279
I'm back (a week later)

I have included the jpeg.dcu into my uses, but i still get a bitmap with jpeg extension.
When I do it the other way round( i.e jpeg to bitmap), i get a jpeg with bitmap extension.


0
 
LVL 17

Expert Comment

by:inthe
ID: 1356280
first your question was :
How do i save a bitmap as a jpeg, using a TImage.well that question is answered,what you want to do is convert a jpg to a bitmap which is different,below is a link to efg's source for doing this.it is source for bmp to jpg(visa versa) for commandline ,but you should be able to see whats happening
Happy coding
Regards Barry

http://www.efg2.com/lab/library/delphi/graphics/BMPtoJPG.PAS.txt
0
 
LVL 17

Expert Comment

by:inthe
ID: 1356281
also go here:
http://www.efg2.com/lab/Graphics/BMPJPG.htm

and download bmpjpg.zip,has full sources inside for doing conversions
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1356282
Well, here is the missing bit I think...

You can make another TImage then just assign the graphic to the bitmap to convert the graphic to the bitmap (the graphic property will contain the JPEG image you loaded into it). Like this:

  image2.picture.bitmap.assign(Image1.picture.graphic);

However, if you want to go both ways this is perhaps not a suitable solution...

Cheers,

Raymond.
 
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1356283
Hi All,
Interesting, browsing through these back end questions, I'm currently working on a Word doc to JPEG converter, and I see some input here, I had already all the pieces working only with quite some overhead.

:O)Always happY.
0
 

Author Comment

by:WarheaD
ID: 1356284
Hey inthe

The conversion doesn't work either way, but thanks for the links. I'll give you the points anyway, because everyone here says it should work too. So just answer again so i can give them to you.
0
 
LVL 17

Accepted Solution

by:
inthe earned 30 total points
ID: 1356285
hi there warhead
ok then i'll answer but what do you mean the conversion dosent work either way?
did you download bmpjpg.zip ?
it contains both sources and executables to convert from one to the other. jpgtobmp.exe and bmptojpg.exe
Regards Barry
0
 

Author Comment

by:WarheaD
ID: 1356286
hi inthe

Although the answer wasn't correct, i've assigned the ponts to you.

Cheers

P.S BoRiS E-mailed me the correct answer!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
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.
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…

860 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