Re: Reloading a Bitmap

[email protected] (James Lynes)
Newsgroups perl.wxperl.users
Message-ID <CABPysehG78fNunqRkUbsUS7mWMqUVvep5Q4YAe-VhQw7ZnT1iw@mail.gmail.com>
Steve:

SetBitmap works, as in:

    $frame->{bmp} = Wx::Bitmap->new("dwf.png", wxBITMAP_TYPE_PNG);
    $frame->{sbm}->SetBitmap($frame->{bmp});

Where $frame->{sbm} is a Static Bitmap.

When I create a new bitmap assigned to $frame->{sbm}, is the system
reclaiming the memory used by the old bitmap?

I saw in the wxWidgets docs that there is a Bitmap method newFromPNGData
that appears to not be wrapped. This would be useful if it would bypass the
need to write/read to/from disk everytime the PNG file changes.

Thanks again for your responses.

James


On Thu, Jun 18, 2015 at 6:21 AM, Steve Cookson - gmail <
[email protected]> wrote:

> Hi James,
>
> On 17/06/15 15:14, James Lynes wrote:
>
>> I will try the SetBitmap method. Take a look at the wxStaticBitmap demo
>> in the wxDemo package. It appears to be broken. It does a ->SetBitmap
>> followed by a ->Refresh. The bitmap is not clearing(for me at least).
>>
> No, it doesn't for me either.
>
> I'll look into it some more.
>
> Regards,
>
> Steve.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.