[ 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: 123456789[10] ]

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

Date Posted: 21:29:10 06/08/00 Thu
Author: Michel
Subject: Re: GrayScale images
In reply to: Bill Mears 's message, "Re: GrayScale images" on 09:27:35 06/08/00 Thu

Hi Bill,

Have you checked to see what is the resulting image format after the scan? I assume it is ifColor256, and this is why the TJpegGraphic does not save it. Unfortunately, the ImageFormat is a read only property, so it cannot be changed directly. I would try using the TImageFormatTransform, to change it to ifGray256 before saving it. This is somewhat confusing, because I suspect that even if you requested ifGray256, the resulting image is ifColor256, since there is really no difference between the two, except the palette.

Best regards,


> >
> > Hi Joerg,
> >
> > As you have seen, the OnAcquire event returns a
> > DibHandle from the scanner. Then
> > AssignFromDIBHandle(DibHandle) is used to get the
> > resulting image. Unfortunately, from a DibHandle
> > (which is really a memory handle holding bitmap
> > information), it is not possible to determine if an
> > image is gray scale, as a gray scale image is really
> a
> > color palette image with all palette entries having
> > gray colors.
> >
> > JPEG does not support color palette images so this is
> > why you are getting this error. You will need to
> > change the format from ifColor256 to ifGray256
> > yourself (by looking at the Palette property) before
> > saving as JPEG.
> >
> > Best regards,
> >
> > Michel
> >
> > > Hi Michel,
> > >
> > > it's again me... Now I tried to scan and save
> > > grayscale image but failed. Envision function to
> get
> > > image format never returns gray scale (EnScan.pas).
> > > Saving scanned image as JPeg creates exception like
> > > "image must be grayscale or truecolor". Please
> check
> > > it, thank you.
> > >
> > > Best regards from germany
> > > Joerg
> I tried using the "RequestedImageFormat" of ifGray256
> to save as a Jpeg and I got the same error. The only
> way I could get the scan done was to save as a PCX as
> ifBlackWhite

[ 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.