Re: Can you display a bitmap with/inside of a sizer?

[email protected] (James Lynes)
Newsgroups perl.wxperl.users
Message-ID <CABPysego=9oMxGW_5j5SGX7wU-6paRFhGaD6YLaO6CD7FSkRpg@mail.gmail.com>
Steve, thanks! Did the job.

But, of course, one question leads to at least one more.....

I would like the bitmap to be displayed to the right of a column of
TextCtrls. Currently the TextCtrls are being displayed under the bitmap now
that I'm not using an onPaint event . Do I need to create two sub-panels
with sub-sizers, one for the bitmap and one for the TextCtrls? Or should
the top sizer be a horzontal rather than vertical? Trying to make some
sense of this sizer stuff.

James

PS: Did you find your memory leak?

On Mon, May 4, 2015 at 11:32 AM, Steve Cookson <[email protected]>
wrote:

> Hi James,
>
> You want Wx::StaticBitmap, like this:
>
>     my $bmp = Wx::Bitmap->new("path/to/bitmap.png", wxBITMAP_TYPE_PNG) ;
>     my $sbm = Wx::StaticBitmap->new($parent, wxID_ANY, $bmp,
> wxDefaultPosition, wxDefaultSize, );
>     $sizer->Add($sbm, 0, 0, 0);
>
> Regards
>
> Steve.
>
>
>
> On 02/05/15 16:05, James Lynes wrote:
>
>> Good day!
>>
>> I'm working on a little app to design common emitter amplifiers. I
>> created a circuit schematic with Eagle and exported it to a PNG file.
>>
>> I am currently displaying the PNG at a fixed location of the screen with:
>>
>>     Wx::Event::EVT_PAINT($self, sub {
>>         my ($self, $event) = @_;
>>         My $dc = Wx::PaintDC->new($self);
>>         my $bmp = Wx::Bitmap->new("CEAmpImg.png, wxBITMAP_TYPE_PNG);
>>         $dc->DrawBitmap($bmp, 150, 50, 1);});
>>
>> If would be nice if I could blend this in with the sizers that are
>> controlling the layout of the input and output TextCtrls.
>>
>> Thanks for your ideas.
>>
>> James
>>
>>
>>
>
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.