Solved

Gif and tif file support to JPEGImage

Posted on 1998-11-16
6
469 Views
Last Modified: 2013-11-19
Hi!
How i can add gif and tif file support to JPEGImage, is there any dlls for that or some other way to add that support.

mhieta
0
Comment
Question by:mhieta
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:BlackMan
ID: 1346950
There is a great FW GIF component (with source) at www.melander.dk
0
 

Accepted Solution

by:
scheiko earned 20 total points
ID: 1346951
Hi mhieta,

I think you'll find everything you're looking for on http://www.melander.dk/delphi/gifimage/index.html

Just download the source and follow the installation instructions...

Good luck!

Scheiko
0
 
LVL 2

Author Comment

by:mhieta
ID: 1346952
Thanks all for answering that question. I don't know if i understanding correctly, with the TJPEGImage to support gifs, is that correct?.

mhieta

0
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.

 
LVL 2

Author Comment

by:mhieta
ID: 1346953
I need also support to tiff images using the JPEGImage.

mhieta
0
 

Expert Comment

by:scheiko
ID: 1346954
I've never heard of a patch or TTIFFImage object.

You can use the standard borland delphi3 TJPEGImage object to LoadFromFile a JPG picture:

Procedure TForm1.Button1Click (Sender:TObject);
var aJPG: TJPEGImage;
begin
     aJPG:=TJPEGImage.Create; {New JPEG Instance}
     if OpenDialog1.Execute then begin {If you've selected a filename}
          try
               aJPG.LoadFromFile; {Load the JPG from disk}
               PaintBox1.Canvas.Draw(0,0,aJPG); {Draw the JPG starting at (0,0)}
          finally
               aJPG.Free;
          end;
     end;
end;

The same construction is used for the TGIFImage:

Procedure TForm1.Button1Click (Sender:TObject);
var aGIF: TGIFImage;
begin
     aGIF:=TGIFImage.Create; {New GIF Instance}
     if OpenDialog1.Execute then begin {If you've selected a filename}
          try
               aGIF.LoadFromFile; {Load the GIF from disk}
               PaintBox1.Canvas.Draw(0,0,aGIF); {Draw the GIF starting at (0,0)}
          finally
               aGIF.Free;
          end;
     end;
end;

Use the Canvas.StretchDraw(TRect,Image) function to resize the pictures. You can not change the JPG's parameters. You'll need to copy the JPG to a TBitMap first, work on the bitmap, and then create a new TJPEGImage which is a copy of your bitmap.

Good luck!

Scheiko


0
 
LVL 2

Author Comment

by:mhieta
ID: 1346955
Thanks Scheiko.

mhieta
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
Simple Delphi Question 9 89
how to change, disabled button color FMX ? 1 32
Tvertscrollbox like a whatsapp layout 5 26
can i put an image from resource into image tag ? 6 24
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…
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…
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…

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

14 Experts available now in Live!

Get 1:1 Help Now