On Fri, 17 Aug 2007 23:04:53 +0400
skywriter <[EMAIL PROTECTED]> wrote:

> > Add before LoadFromFile:
> >     myPict.GetDescriptionFromDevice(0);
> >
> > Reason:
> > TLazIntfImage needs the image format (bit depth, colors, ...) of the
> > target (your screen).
> 
> Necessity of calling GetDescriptionFromDevice(0); is not obvious for 
> developer. We accustomed the object is ready for use after
> construction because task of constructor is creating and preparing of
> object for work.

TLazIntfImage is a flexible storage object, used where TBitmap is too
slow or too high level.
Feel free to add some more constructors for the various purposes. For
example, one constructor for a device context, one for a TBimap, one
for a rawimage description, one for a raw image, and maybe several for
common formats.


> Leastwise TBimap and TRGB32Bitmap work this way.

TBitmap is a high level class.


> I think IDE in similiar situations should return more obvious error 
> message than just execution stop. Isn't it?

Yes. But this case is tricky.
You created an image in the wrong format and sent it to the gtk
library. The gtk library passed it further to the X library which is
infamous for its error codes. The debugger can not get any useful stack
trace nor output, because X seems to bypass it.


Mattias

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

Reply via email to