Solved

Loading JPEG

Posted on 2003-12-09
2
351 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
[X]
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
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

Technology Partners: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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