Solved

Loading JPEG

Posted on 2003-12-09
2
349 Views
Last Modified: 2010-04-05
TImage can load BMP and also JPEG.

How can I assign JPEG in TImage into a TBitmap ?

I tried like this :

  ATImage := ATImage.Create(nil);
  ATImage.Picture.LoadFromFile(OpenDialog1.Filename);  // Load BMP or JPEG
  ATBitmap.Assign(ATImage.Picture.Bitmap);
  ATImage.Free;

That is working fine with BMP but not with JPEG.

Also, why TOpenPictureDialog can only load BMP ? If I see its 'filter', it contains other extension also.
0
Comment
Question by:muis2002
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 9904909
add into the uses clause the jpeg-unit and all works,
even the TOpenPictureDialog

meikl ;-)
0
 

Author Comment

by:muis2002
ID: 9905143
Okay, the TOpenPictureDialog is working now with JPEG.

And I must change the code like this :

  ATBitmap.Assign(ATImage.Picture.Graphic);

Thanks !
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to renew a Delphi rad-studio licence? 5 74
LAN or WAN ? 11 105
can i put an image from resource into image tag ? 6 30
Using MMsystem To change audio input 1 14
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 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