# Create the Display(bmp & sbm) and Drawing(image) Objects # Uses GD calls to draw the screen background and waveform on the image object $self->{bmp} = Wx::Bitmap->new("rawaudio.png", wxBITMAP_TYPE_PNG); $self->{sbm} = Wx::StaticBitmap->new($self, wxID_ANY, $self->{bmp}, wxDefaultPosition, [600,600]); $oscope->{image} = GD::Image->new($oscope->{maxw}, $oscope->{maxh}) || die; # Read the updated image and refresh the display $self->{bmp} = Wx::Bitmap->new("rawaudio.png", wxBITMAP_TYPE_PNG); # Reload the screen image $self->{sbm}->SetBitmap($self->{bmp}); # Refresh screen # Save the Drawing Object to a disk file my $png_data = $oscope->{image}->png; # Write image to a file open OUTFILE, ">", "rawaudio.png" || die; binmode OUTFILE; print OUTFILE $png_data; close OUTFILE;