Saving a (image) file in different format
-
Hi, I'm generating an html page on-the-fly in my application. This page should contain images. The images i have in the DB are of formats that cannot be used in html (jpeg, png etc) so i need to save them in gif format. Does anybody have a lead on how to save these image files in gif format? Thanks in advance.
-
Hi, I'm generating an html page on-the-fly in my application. This page should contain images. The images i have in the DB are of formats that cannot be used in html (jpeg, png etc) so i need to save them in gif format. Does anybody have a lead on how to save these image files in gif format? Thanks in advance.
-
I guess you can open them in MS Paint and then save them to the bmp/gif format. Paint does the conversion._
Fortitudine Vincimus!_
-
Hi, I'm generating an html page on-the-fly in my application. This page should contain images. The images i have in the DB are of formats that cannot be used in html (jpeg, png etc) so i need to save them in gif format. Does anybody have a lead on how to save these image files in gif format? Thanks in advance.
you can certainly use both JPG and PNG in HTML. Cleek | Image Toolkits | Thumbnail maker
-
you can certainly use both JPG and PNG in HTML. Cleek | Image Toolkits | Thumbnail maker
I suppose that depends entirely on what braindead (or not) browser you've got.
-- Presented in BC [Brain Control] where available
-
Hi, I'm generating an html page on-the-fly in my application. This page should contain images. The images i have in the DB are of formats that cannot be used in html (jpeg, png etc) so i need to save them in gif format. Does anybody have a lead on how to save these image files in gif format? Thanks in advance.
GDI+ is the simplest to use for image format conversions. You simply load the image, set the encoder and save the image to file or stream. GDI+ is slow but it has proven itself to be very useful in terms of image manipulation and advanced effects. It has a native C interface that Microsoft wraps with a C++ wrapper class. Be forewarned, if you come from an MFC background, their wrapper classes are somewhat frustrating and obviously designed by the Herb Sutter camp of "You should not be coding that way so we'll make it harder to shoot yourself in the foot" program team. But, at the end of the day, it saved me tons of development time so I tend to overlook it's poor interface and still recommend it when performance is not critical.
-
GDI+ is the simplest to use for image format conversions. You simply load the image, set the encoder and save the image to file or stream. GDI+ is slow but it has proven itself to be very useful in terms of image manipulation and advanced effects. It has a native C interface that Microsoft wraps with a C++ wrapper class. Be forewarned, if you come from an MFC background, their wrapper classes are somewhat frustrating and obviously designed by the Herb Sutter camp of "You should not be coding that way so we'll make it harder to shoot yourself in the foot" program team. But, at the end of the day, it saved me tons of development time so I tend to overlook it's poor interface and still recommend it when performance is not critical.
bob16972 wrote:
their wrapper classes are somewhat frustrating
I once worked with a guy who had been on the GDI+ team (or done some work for them; was never clear on that.) My first question was: Why? His eventual answer was that the whole thing was essentially a proof-of-concept and never intended to be released. My next question was whether Microsoft Engineers have to put up with designs like this for stuff that really is internal. I got no answer. (Given the horrific design of the TreeView and ListView controls, I suspect I knew the answer.) Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
-
bob16972 wrote:
their wrapper classes are somewhat frustrating
I once worked with a guy who had been on the GDI+ team (or done some work for them; was never clear on that.) My first question was: Why? His eventual answer was that the whole thing was essentially a proof-of-concept and never intended to be released. My next question was whether Microsoft Engineers have to put up with designs like this for stuff that really is internal. I got no answer. (Given the horrific design of the TreeView and ListView controls, I suspect I knew the answer.) Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
Joe Woodbury wrote:
Why?
:-D It is indeed an oddity why they didn't just add some additional flags to some GDI functions and a few new methods for the image manipulation routines. At this point in the game, I'm glad the additional functionality is available somewhere since implementing routines for all the image file formats would have set me back a few more years.
Joe Woodbury wrote:
never intended to be released
The sad part is, I was actually anticipating the next release of GDI+ for roughly a year until I came to my senses and realized they had indeed abandoned it's development in favor of the utilization of the DirectX layer that now is apparently underneath all the Vista graphics. Live and learn. :: sigh ::
-
Joe Woodbury wrote:
Why?
:-D It is indeed an oddity why they didn't just add some additional flags to some GDI functions and a few new methods for the image manipulation routines. At this point in the game, I'm glad the additional functionality is available somewhere since implementing routines for all the image file formats would have set me back a few more years.
Joe Woodbury wrote:
never intended to be released
The sad part is, I was actually anticipating the next release of GDI+ for roughly a year until I came to my senses and realized they had indeed abandoned it's development in favor of the utilization of the DirectX layer that now is apparently underneath all the Vista graphics. Live and learn. :: sigh ::
-
libtiff libjpeg are decent places to start. You might have to write the code that dumps to gif, I dunno, but at least the first two will decompress to bitmap or something similar. Why, again, do you think browsers won't read jpg or png? earl
-
earl wrote:
Why, again, do you think browsers won't read jpg or png?
When exactly did I say that? I think your post got linked incorrectly