Board index » delphi » Bitmap Pointers

Bitmap Pointers

Hello,

I realize that there is an apparent limit to the number of bitmaps that
can be created/used without running out of system resources.

I've been thinking that maybe by using pointers I could get around this.

I have a GIF loaded that has say, 250 frames.  If I try to load these
into a thumbnail viewer by assignment, the system will hang completely.

Would something along these lines resolve the problem or am I just
spinning my wheels again?

procedure Dummy;
var
    bPtrList : Array[0..4] of PBitmap;
    ImgLst   : Array[0..0] of TImage;
    i : integer;
begin
    // GIF is a TGIFImage structure using
    // Anders Melander's TGIFImage
    for i := 0 to 4 do
       begin
          bPtrList[i] := PBitMap(GIF.Images[i].Bitmap);
          ImgLst[i].Picture.Assign(TBitmap(bPtrList[i]));
       end;
end;

This way I would only need to reallocate the pointers in order to
'shuffle' the images that are already containted in the GIF.

Thanks,

Paul A. Denton
paden...@mindspring.com

 

Re:Bitmap Pointers


On Fri, 15 Oct 1999 01:39:02 -0500, "Paul A. Denton"

Quote
<paden...@mindspring.com> wrote:
>I've been thinking that maybe by using pointers I could get around this.

No. The limitations are imposed by the operating system, not by
Delphi. It's the creation of the Windows data structures that causes
you to run out of resources.

Besides, object-type variables in Delphi are _already_ pointers.

-Steve

Re:Bitmap Pointers


No it would not solve your problem..
 use a TImageList.
  This will create 1 bitmap for all images as long as they are the same size
i guess?, i am not sure about
variant sizes here but i do know that TIMageList was created just for this
purpose..
 it contains the basic functions you need to draw the images and add to the
list ect..
 for a Thumbs Nails display you use a single  image and tile them, then
partition the mouseMove
X,Y and create a Location index as the mouse moves across the image, when
and if you click on one of the
tiles you will know which one it is ect....
Quote
"Paul A. Denton" wrote:
> Hello,

> I realize that there is an apparent limit to the number of bitmaps that
> can be created/used without running out of system resources.

> I've been thinking that maybe by using pointers I could get around this.

> I have a GIF loaded that has say, 250 frames.  If I try to load these
> into a thumbnail viewer by assignment, the system will hang completely.

> Would something along these lines resolve the problem or am I just
> spinning my wheels again?

> procedure Dummy;
> var
>     bPtrList : Array[0..4] of PBitmap;
>     ImgLst   : Array[0..0] of TImage;
>     i : integer;
> begin
>     // GIF is a TGIFImage structure using
>     // Anders Melander's TGIFImage
>     for i := 0 to 4 do
>        begin
>           bPtrList[i] := PBitMap(GIF.Images[i].Bitmap);
>           ImgLst[i].Picture.Assign(TBitmap(bPtrList[i]));
>        end;
> end;

> This way I would only need to reallocate the pointers in order to
> 'shuffle' the images that are already containted in the GIF.

> Thanks,

> Paul A. Denton
> paden...@mindspring.com

Other Threads