Solved

Loading JPEG

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

12 Experts available now in Live!

Get 1:1 Help Now