From: "Mark L. Tiede" Subject: Re: Fractal compression and Delphi 4.0? Date: 26 Jan 1999 00:00:00 GMT Message-ID: <36AE1373.D4AA5A30@mjwcorp.com> References: <36A4FBB0.F09C55F7@mjwcorp.com> <36A58C54.2C37D64B@smatters.com> <36A5DC4F.D63C7B49@ibm.net> <36A61B69.F5046DC0@smatters.com> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------13BAE811731E631FC9411B9E" Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.delphi.graphics This is a multi-part message in MIME format. --------------13BAE811731E631FC9411B9E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Davie, I have a little more information on my problems using the FIF example code that was on the CD for Delphi. I know where it bombs and sort of why. In the GetBitmap code in FIF.PAS, there is a combination of lines that fails. First there is a GetObject that is trying to get the DIB. Then there as a DecompressToBuffer(DIB.dsbm.bmBits, 0,0,0,0, RowStride). The problem is that when the GetObject is called the FBitmap.Handle seems to be invalid. The original code was not checking for errors. I changed the code to: Err := GetObject( FBitmap.Handle, SizeOf(DIB), @DIB); if Err = 0 then RaiseLastWin32Error; This produced the message code 183: "Can not create a file when that file already exists." Which, to me, makes no sense whatsoever. Then, after screwing around looking through source code, I tried to do: type TBitmapCracker = class( TBitmap ); TBitmapCracker(FBitmap).HandleNeeded; HandleTemp := FBitmap.Handle; Err := GetObject( HandleTemp, SizeOf(DIB), @DIB); I thought the HandleNeeded routine might do its work. I got the same error message. Then I tried: type TBitmapCracker = class( TBitmap ); TBitmapCracker(FBitmap).PaletteNeeded; HandleTemp := FBitmap.Handle; Err := GetObject( HandleTemp, SizeOf(DIB), @DIB); if Err = 0 then RaiseLastWin32Error; Surprisingly, now I get a code 6: "The handle is invalid" That message makes more sense, but how do I get a valid handle to get the DIB? Thanks --------------13BAE811731E631FC9411B9E Content-Type: text/x-vcard; charset=us-ascii; name="mtiede.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Mark L. Tiede Content-Disposition: attachment; filename="mtiede.vcf" begin:vcard n:Tiede;Mark tel;work:(716) 631-8291 x-mozilla-html:TRUE url:www.mjwcorp.com org:MJW Corporation Inc.;Multimedia Department adr:;;338 Harris Hill Road, Suite 208;Williamsville;NY;14221;USA version:2.1 email;internet:mtiede@mjwcorp.com fn:Mark L. Tiede end:vcard --------------13BAE811731E631FC9411B9E--