Solved

Gif and tif file support to JPEGImage

Posted on 1998-11-16
6
467 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX StringGrid1->Canvas->FillRect Problem 3 127
High Resolution .gif files 3 78
tidtcpserver connection lost handle 2 70
Create a path if not exists 7 69
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now