Lord Satan wrote:
On Mon, 17 Sep 2007 20:32:50 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:

<snip>

The error is an 'invalid type cast'.

(1)

That comes somewhere. If you run your app in lazarus, dou you get a call stack when you get this exception ?

Nope, but I don't use a debugger in lazarus.

With this result, you might consider doing so, you could have found the cause.

I just tried again and loading a png works, but loading a bmp fails. At least I 
managed to produce a hopefully more meaningful backtrace:

(gdb) bt

[snip]

#14 0x08060bd8 in fpc_do_as ()
#15 0x08154662 in TLAZREADERBMP__INTERNALREADBODY (this=0xb7f74090) at 
intfgraphics.pas:4591

(2)

Some sources, intfgraphics.pas:4591 -> (3)
  FImage := TheImage as TLazIntfImage;



1 + 2 + 3 ->

The class of TheImage is not a TLazIntfImage ! From your source, its a TFPCustomImage.

TLazReaderBMP only supports TLazIntfImage, so derive your image from TLazIntfImage or don't use TLazReaderBMP.

Marc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to