VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123[4]5678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 20:47:57 04/20/03 Sun
Author: Michel
Subject: Re: Can't Save JPEG or BMP in color?????
In reply to: dave bracken 's message, "Can't Save JPEG or BMP in color?????" on 15:00:38 04/15/03 Tue


Hi Dave,

This is a particularity of the JPEG format. It is optimized for true color images and 256 gray scale (photographic like).

You will need to check ImageScrollBox.Graphic.ImageFormat, and if it is not ifTrueColor or ifGray256, you must convert it to save it as JPEG. For example, if it is, ifColor256, you must convert it to true color with the TImageFormatTransform before saving.

Best regards,

Michel

>I have a scanning app, that pulls images in as a dib.
>My users need the option to save these images as Tif,
>Jpeg, or BMP. I have a color scanner, i set the Mode
>to 24-bit color, and set my file extension and
>filename with .jpg.
>
>The code after scan looks like the following:
>
>aa := Scan1.hDib;
>ImageScrollBox.Graphic.AssignFromDIBHandle(aa);
>GlobalFree(aa);
>ImageScrollBox.Redraw(true);
>ImageScrollBox.SaveToFile(flename);
>
>It always gets an error here that says the jpeg must
>be grayscale.
>Why?
>It is not coming in as grayscale, it is set to color.
>So will it not save(or display for that matter) in
>color?
>I looked again and again at your sample app Demo.dpr,
>but to no avail. Your sample app does not show
>specifics on saving as jpeg in color vs tif in black
>and white, etc...
>
>Please help!!!!
>Thanks in advance,
>Dave

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.