Link to home
Start Free TrialLog in
Avatar of andru
andru

asked on

Why lousy JPG support with Delphi

Hi Ppl

Why is JPG support so lousy with Delphi? Are there any work arounds?

I've put Jpeg in the uses clause as I have done before I was reminded on another thread of the same subject. But, the only thing is JPGs take ages to load, and when my software tries to modify a image I get the error 'Can only modify an image if it contains a bitmap'.

How can I convert a jpeg image to DIB format so that I can modify the image?

TIA
ASKER CERTIFIED SOLUTION
Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Quote from Delphi help

<DIBNeeded is used when the jpeg image needs a bitmap representation of its image. Call DIBNeeded just before drawing rather than while drawing for optimization.>
Avatar of BlackTigerX
BlackTigerX

how do you "try to modify the image"?
SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi --

I use a great component called TImageEn .. You can find it here

http://www.hicomponents.com/nimageen.asp

Rich
?? well, rwmorey , will be a nice TImage-replacement, but solves not the entire question

meikl ;-)
Hi..

Sorry.. You are right I did not answer the complete question. There is the ability to load and save various file formats, including converting from one format to another (GIF, TIFF, JPEG, BMP, WMF) and I am pretty sure you can manipulate the images in any of the formats through the various included components.

Rich
Avatar of andru

ASKER

procedure tblink_form.load_image(
  name:string);
var
  picture:tpicture;
begin
  picture:=tpicture.create;
  picture.LoadFromFile(name);
end;

When a Jpeg has been loaded with the above code, how do I make it so that I can modify the image in picture?

TIA
>When a Jpeg has been loaded with the above code, how do I make it so that I can
>modify the image in picture?

transform it into a bitmap,
manipulate it,
transform back to jpeg

see my small sample above

meikl ;-)
Avatar of andru

ASKER

How do I know if the image is a jpeg as it is coming via the load image dialog.

TIA