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: 16:37:45 01/10/03 Fri
Author: Paul Mead
Subject: Re: GetDIB failed on XP
In reply to: Michel 's message, "Re: GetDIB failed on XP" on 06:44:09 09/30/02 Mon

Hi Micheal

I had this problem earlier and used your suggestions to fix. GlobalAlloc instaed of GetMem at the one location in EnDiGrph.pas. This appeared to fix the problem, but now it is surfacing again on one New XP machine. GetDIB error. Funny this time it appears almost as a memory leak. Restart our program and it is good for a while than boom, restart and we are good for a while again.


>
>Hi Ed,
>
>I will email you directly a revised EnDiGrph.Pas. It
>has been reported to me that memory obtained with the
>VCLs GetMem causes failure on some graphic windows API
>calls.
>
>Let me know if this solves the problem on XP. You will
>see new calls to AllocMem instead of GetMem.
>
>Best regards,
>
>Michel
>
>>I have a program that creates multiple bitmaps and
>>saves them as tif files. It works fine on my Windows
>>2000 box all the time, but when I tried it on XP, I
>>sometimes get an error "GetDIB failed" (Maybe 50% of
>>the time). It gets the error when it tries to read
>>the bitmap I just saved to a file. I have included
>>sample code for you below. Just drop a ImageScrollBox
>>on a form with a button. When the button is pressed,
>>it should create 6 tiff image files.
>>
>>
>>procedure TForm1.Button1Click(Sender: TObject);
>>Var
>> Index : Integer;
>> ImageBitmap : TBitmap;
>>begin
>> ImageScrollBox1.Clear;
>>
>> ImageBitmap := TBitmap.Create;
>> try
>> With ImageBitmap do
>> begin
>> Monochrome := True;
>> Width := Round(300 * 8.5);
>> Height := 300 * 11;
>> Canvas.Font.Size := 24;
>> end;
>>
>> For Index := 1 to 6 do
>> begin
>> With ImageBitmap do
>> begin
>> Canvas.FillRect(Rect(100, 100, 800, 150));
>> Canvas.TextOut(100, 100, 'Test Image #' +
>>IntToStr(Index));
>> SaveToFile('Temp.bmp');
>> Application.ProcessMessages;
>> end;
>>
>> ImageScrollBox1.LoadFromFile('Temp.bmp', 1);
>> ImageScrollBox1.SaveToFile('Image' +
>>IntToStr(Index) + '.tif');
>>
>> DeleteFile('Temp.bmp');
>> end;
>> finally
>> ImageBitmap.Free;
>> end;
>>end;

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


Replies:


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