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: 1234567[8]910 ]


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

Date Posted: 18:30:48 05/29/01 Tue
Author: Michel
Subject: Re: GetDIB failed
In reply to: Jason Southwell 's message, "Re: GetDIB failed" on 16:33:53 05/29/01 Tue


Hi Jason,

Thanks for the suggestion. Currently I have,

The only way to distinguish when to use bmDDB or bmDIB is to use the PixelFormat property. With the 16 bit bitmap test case, the pixel format is pfCustom }
if TBitmap(Source).PixelFormat = pfCustom then
TBitmap(Source).HandleType := bmDDB
else
TBitmap(Source).HandleType := bmDib;

I'm not sure why I used pfCustom instead of pf16Bit.

I'll do some tests, and change it as appropriate.

Best regards,

Michel
>I have found what appears to be a fix to this problem.
> Make the following change to your EnDiGrph.pas file:
>
>Line 1006, in procedure TDibGraphic.Assign(Source:
>TPersistent);
>
>Change:
> { MB Oct 28, 1999. The AssignFromBitmapHandle
>works with a device
> dependent bitmap. This is required to load
>16 bit bitmaps, in order
> to convert them to 24 bits using the GetDIB
>function. }
> TBitmap(Source).HandleType := bmDDB;
>
>To:
> { MB Oct 28, 1999. The AssignFromBitmapHandle
>works with a device
> dependent bitmap. This is required to load
>16 bit bitmaps, in order
> to convert them to 24 bits using the GetDIB
>function. }
> if TBitmap(Source).PixelFormat = pf16Bit then
> TBitmap(Source).HandleType := bmDDB
> else
> TBitmap(Source).HandleType := bmDIB;
>
>
>This forces the component to only use a Device
>Dependant BMP when it needs to for 16bit graphics.
>24bit graphics use Device Independant BMPs and are not
>dependant on the graphics hardware to build the Bitmap
>for you which appears to have been causing the problem.
>
>
>
>
>>
>>Hi Jason,
>>
>>I wish there was a workaround and clear answer to this
>>problem.
>>
>>EFG's computer lab has done some testing on this, and
>>there are suggestions, but none are straight forware
>>to implement.
>>
>><a rel=nofollow target=_blank href="http://homepages.borland.com/efg2lab/Graphics/VeryLarg">http://homepages.borland.com/efg2lab/Graphics/VeryLarg</a>
>e
>>Bitmap.htm
>>
>>Best regards,
>>
>>Michel
>>>I too am having this problem on some large jpgs.
>What
>>>solution have we found to this showstopping problem?
>>>
>>>
>>>>Hello Michel,
>>>>Good to know that the error comes from the windows
>>>>API. But how can it be corrected?
>>>>
>>>>Thanks
>>>>Michael
>>>>
>>>>>
>>>>>Hi Michael,
>>>>>
>>>>>I this occurring on a large image?
>>>>>
>>>>>This is the result of the Windows API call
>>GetDIBits
>>>>>failing, when retrieving pixel information from a
>>>>>bitmap handle to get the pixels for the TDibGraphic
>>>>>object.
>>>>>
>>>>>Best regards,
>>>>>
>>>>>Michel
>>>>>
>>>>>>After inserting some pictures I get suddenly the
>>>>>>message "GetDIB failed". What is wrong here?
>>>>>>
>>>>>>Thanks
>>>>>>Michael

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