From: "Finn Tolderlund" Subject: Re: about scanline & freeimage Date: 29 Jan 2001 00:00:00 GMT Message-ID: <3a7512bd$1_1@dnews> References: <3a74f0bf_1@dnews> X-Trace: 28 Jan 2001 22:50:37 -0800, 212.97.244.58 X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: borland.public.delphi.graphics X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 "Emre ERCAN" skrev i en meddelelse news:3a74f0bf_1@dnews... > I solved problems with FREEIMAGE procedure in many tries but i didn' t how > it worked. > What is the FREEIMAGE procedure' s secret ? If it doesn' t used, i think > bitmaps are mixed. If you assign the same bitmap to 2 TBitmaps they will both point to the same one bitmap in memory. They are reference counted, like strings. If you then use Scanline you get a *pointer* to the bitmaps. And since both Scanline pointers point to the same bitmap, modifiyng one bitmap using the Scanline will also modify the second bitmap, since there is only one bitmap. What the FreeImage method does, is simply to make another copy of the bitmap so that you now have 2 different bitmaps in memory. That's why it works when you use FreeImage. This is done automatically in Delphi5 when you use Scanline, but it is not done in Delphi 4 (or prev) so you will have to call FreeImage yourself if you are using D3-D4. Finn Tolderlund