Solved

Loading JPEG

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why does formely good SQL code in Delphi 2009 not work under Windows 10? 5 95
code issue 8 126
Correct Component for Shopping Cart. 2 104
How to build JSON File in Delphi 6 3 32
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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now