Solved

Gif and tif file support to JPEGImage

Posted on 1998-11-16
6
466 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
Comment Utility
There is a great FW GIF component (with source) at www.melander.dk
0
 

Accepted Solution

by:
scheiko earned 20 total points
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Author Comment

by:mhieta
Comment Utility
I need also support to tiff images using the JPEGImage.

mhieta
0
 

Expert Comment

by:scheiko
Comment Utility
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
Comment Utility
Thanks Scheiko.

mhieta
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to set up basic frames and paths in Prezi and understand the open space that Prezi allows you to create presentations in.

771 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