[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Source Code for saving to JPEG

I need to find source code or a Delphi component that I can compile into my EXE. Source can be C, C++ but preferably Delphi object pascal

thank you
0
d_kiernan
Asked:
d_kiernan
  • 4
  • 2
1 Solution
 
viktornetCommented:
Do you need a component or just a source code on how to work with JPG???

Regards,
Viktor Ivanov
0
 
erajojCommented:
Using Delphi 3 or 4?

/// John
0
 
d_kiernanAuthor Commented:
I am currently using Delphi 3 and C++ Builder 3 and what I need is code (source prefrerrably) to save a bitmap out to JPEG. I can't use DLL's I need all the code to be within the EXE.

Donagh
0
Industry Leaders: 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!

 
viktornetCommented:
here is what you need...

var
  MyJpeg: TJpegImage;
  Image1: TImage;
begin
  Image1:= TImage.Create;
  MyJpeg:= TJpegImage.Create;
  Image1.LoadFromFile('TestImage.BMP');
  MyJpeg.Assign(Image1.Picture.Bitmap);  
object
  MyJpeg.SaveToFile('MyJPEGImage.JPG');
end;
Hope this helps..
Regards,
Viktor Ivanov
0
 
viktornetCommented:
There is a word object which is not suppose to be there,....just erase it =)

Regards,
Viktor Ivanov
0
 
viktornetCommented:
One more thing ...don't forget to free the objects you created when you finish working with then..like this....

Image1.Free;
MyJpeg.Free;

Regards,
Viktor Ivanov
0
 
d_kiernanAuthor Commented:
Thanks experts, that should do the trick

regards
Donagh
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now