Board index » delphi » GIF/JPG conversion for display, etc.

GIF/JPG conversion for display, etc.

hmmm... I downloaded Richard Dominelli's GIF2BMP.pas unit, but as I am
"new here", I'm a little unsure of exactly what to do with it. I'm
writing a database app one part of which allows the user to browse for
either GIFs or JPGs and assign them to specific "components" in a
"graphic set". I need to do 2 things:

1. display the image in a TImage, and
2. copy the file to a particular directory, renaming it to one of a set
of predefined filenames ie.,

        lrg_hrs(.gif) ---> display BMP in TImage ---> b-back(.gif)

I've found some mention of a TJPEG component in the Delphi help, but am
pretty lost on that one too. Any hints?

TIA!

--
*******************************************************************************
* Peter S. Wason        "Lurching wildly across the purple lawn of the
gods." *
* z...@stumpworld.com   Lead Programmer - Stumpworld Systems,
Inc.            *
* hyn...@kersur.net     Owner/President - Hy Noom
Publications                *
*******************************************************************************
Remember:

"A revolving concretion of earthy or mineral matter accumulates no
congeries of small, green bryophytic plants"

"Replacement of vomerine teeth proceeds medially."

*******************************************************************************
Use of the return address on this message for commercial purposes is
prohibited.
The transmission of unsolicited commercial material is prohibited under
federal
laws (47 USC 227).  Civil penalties and claims of $500.00 per occurrence
(47 USC
227[c]) may be assessed for violations.

 

Re:GIF/JPG conversion for display, etc.


Quote
Pete Wason wrote in message <3532966E.331AB...@stumpworld.com>...
>hmmm... I downloaded Richard Dominelli's GIF2BMP.pas unit, but as I am
>"new here", I'm a little unsure of exactly what to do with it. I'm
>writing a database app one part of which allows the user to browse for
>either GIFs or JPGs and assign them to specific "components" in a
>"graphic set". I need to do 2 things:

>1. display the image in a TImage, and
>2. copy the file to a particular directory, renaming it to one of a set
>of predefined filenames ie.,

>        lrg_hrs(.gif) ---> display BMP in TImage ---> b-back(.gif)

>I've found some mention of a TJPEG component in the Delphi help, but am
>pretty lost on that one too. Any hints?

First, if you have Delphi 3, you can add JPEG support to your program by
simply adding JPEG to your uses clause. If you want JPEG support in design
time, add the JPEG unit to a package (such as dclusr) and install this
package.

As for GIF support, try searching the Delphi Super Page. There are several
components that handle GIF files, and some of them register the format with
Delphi so it can be used with TImage.

With both the JPEG object and certain GIF objects you can use the SaveToFile
method to save an image to the appropriate format.

--
Yorai Aminov
El-On Software Systems, Ltd.
http://ourworld.compuserve.com/homepages/yaminov

Re:GIF/JPG conversion for display, etc.


Quote
Pete Wason <z...@stumpworld.com> wrote:

You can take a look at my TGIFImage library. It is free and comes with
full source and a couple of demos:
  http://www.melander.dk/delphi/gifimage/

Quote
>1. display the image in a TImage, and

TJPEGImage, my own TGIFImage (and the GIF stuff in RXlib I believe)
integrates with TImage.

Quote
>2. copy the file to a particular directory, renaming it to one of a set
>of predefined filenames ie.,

>        lrg_hrs(.gif) ---> display BMP in TImage ---> b-back(.gif)

How about this (Image is a TImage component):

    Image.Graphic.LoadFromFile('OneName.gif');
    ...GIF is now displayed...
    Image.Graphic.SaveToFile('OtherName.gif');

Quote
>I've found some mention of a TJPEG component in the Delphi help, but am
>pretty lost on that one too. Any hints?

Borland has a few TIs on their site that deals with TJPEGImage. What
do you need to know?

(cc via email)

Thank you for flying Air Melander.

+--------------------from usenet----------------------+
|  Anders Bo Melander    | Phone: (+45) 31 87 91 26   |
|  Finsensvej 79, 2. tv. | mailto:and...@melander.dk  |
|  DK-2000 Frederiksberg | http://www.melander.dk     |
|  Denmark               | flameto:bi...@microsoft.com|
+------------------------+----------------------------+

Other Threads