Solved

Loading JPEG

Posted on 2003-12-09
2
356 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

617 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