Solved

Gif and tif file support to JPEGImage

Posted on 1998-11-16
6
471 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
File conversion question 5 118
Magic Software info 18 138
creating threads in delphi 1 132
I need help embedding Base64 Images using VB.Net - When image is a .jpg 2 73
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this Micro Tutorial viewers will learn the basic shortcuts and functions of Illustrator. The viewer will learn about the paintbrush tool, anchor points, font sizing, and more.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

860 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