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: 12345[6]78910 ]


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

Date Posted: 05:56:41 05/06/02 Mon
Author: Michel
Subject: Re: "GetDIB Failed" error with Envision 1.1 (Delphi 5)
In reply to: Jon Scott 's message, ""GetDIB Failed" error with Envision 1.1 (Delphi 5)" on 15:54:35 05/01/02 Wed


Hi Jon,

The correction is not yet the current beta code for version 2. In TDibGraphic.AssignFromBitmapHandle, replace the call to

GetMem(BitmapBits, ImageSize);

with,

BitmapBits := PByteArray(GlobalAlloc( GMEM_FIXED, ImageSize ));
if BitmapBits = nil then
raise EEnvisionError.Create('GlobalAlloc failed');


and in the finally block use,

GlobalFree(Windows.THandle(BitmapBits));

instead of

FreeMem(BitmapBits, ImageSize);

Best regards,

Michel



>Michel,
>
>I've sent you an email to michel@intervalsoftware.com
>with a BMP attachment and steps for the infamous
>"GetDIB Failed" error. Basically, the problem goes
>like this... I need to clear the TImageScrollBox at
>various times in my program, but doing this sometimes
>causes the error when attempting to load the same
>bitmap again. However, this ONLY happens when
>clearing the image control. This can be reproduced
>(on some bitmaps) with just two lines of code:
>
>ImageScrollBox.Clear;
>ImageScrollBox.LoadFromFile('C:\temp\somebmp.bmp', 1);
>
>Do this a few times and you'll get the error. I have
>yet to try v2 Beta. If you still have the problem in
>v2, what can I do to get around this problem?
>
>Thanks,
>Jon.

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