Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
#!/usr/bin/perl -w -- use Wx 0.15 qw[:allclasses]; use strict; package MyFrame; use Wx qw[:everything]; use base qw(Wx::Frame); use strict; sub new { my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_ +; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; $style = wxDEFAULT_FRAME_STYLE unless defined $style; $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $sty +le, $name ); $self->SetTitle("Draw/Video Controls"); $self->{Ctl_Videos_Sizer_2} = Wx::BoxSizer->new(wxVERTICAL); + # Top-level left-hand sizer (contains media) # wxMEDIABACKEND_DIRECTSHOW Use ActiveMovie/DirectShow. Requires w +xUSE_DIRECTSHOW to be enabled, requires linkage with the static libra +ry strmiids.lib, and is available on Windows Only. # wxMEDIABACKEND_QUICKTIME Use QuickTime. Windows and Mac Only. NO +TE: On Mac Systems lower than OSX 10.2 this defaults to emulating win +dow positioning and suffers from several bugs, including not working +correctly embedded in a wxNotebook. # wxMEDIABACKEND_MCI Use Media Command Interface. Windows Only +. # wxMEDIABACKEND_GSTREAMER Use GStreamer. Unix Only. # wxMEDIABACKEND_WMP10 Windows Media Player 9 or 10 # wxMEDIABACKEND_REALPLAYER Realplayer # Blank Allow to choose own player $self->{Ctl_Videos_Media}= Wx::MediaCtrl->new( $self, wxID_ANY, '' +, wxDefaultPosition, [400,300],0, ); $self->{Ctl_Videos_Media}->Show( 1 ); $self->{Ctl_Videos_Media}->ShowPlayerControls(wxMEDIACTRLPLAYERCON +TROLS_DEFAULT); # or wxMEDIACTRLPLAYERCONTROLS_NONE # wxMEDIACTRLPLAYERCONTROLS_STEP # wxMEDIACTRLPLAYERCONTROLS_VOLUME # wxMEDIACTRLPLAYERCONTROLS_DEFAULT $self->{Ctl_Videos_Sizer_2}->Add( $self->{Ctl_Videos_Media}, 0, 0, + 0 ); $self->{Ctl_Videos_ImageViewer_Panel_1} = Wx::Panel->new($self, wx +ID_ANY, wxDefaultPosition, [400,20], ); $self->{Ctl_Videos_Sizer_2}->Add($self->{Ctl_Videos_ImageViewer_Pa +nel_1}, 0, 0, 0); $self->{Ctl_Videos_Button} = Wx::Button->new($self, wxID_ANY, "Loa +d", ); $self->{Ctl_Videos_Sizer_2}->Add($self->{Ctl_Videos_Button}, 0, 0, + 0); Wx::Event::EVT_PAINT($self->{Ctl_Videos_ImageViewer_Panel_1},\&pai +nt); Wx::Event::EVT_BUTTON( $self, $self->{Ctl_Videos_Button}, \&on_med +ia_load ); $self->SetSizer($self->{Ctl_Videos_Sizer_2}); $self->{Ctl_Videos_Sizer_2}->Fit($self); $self->Layout(); return $self; } sub on_media_load { # # Load file button selected # my( $self, $event ) = @_; my $file = Wx::FileSelector('Choose a media file'); # Select vi +deo file if( length( $file ) ) { $self->{Ctl_Videos_Media}->LoadFile ($file); # Load vid +eo file $self->{mediafile}= $file; # Store location of video fi +le in '$self # $self->{Ctl_Videos_Media}->Play(); } } sub paint{ my ($self,$event) = @_; my $dc = Wx::PaintDC->new($self); $dc->DrawRectangle( 0,0, 400,20 ); $event->Skip; } package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $frame_1 = MyFrame->new(); $app->SetTopWindow($frame_1); $frame_1->Show(1); $app->MainLoop(); }

In reply to Wx::MediaCtrl and Wx::PaintDC by Steve_BZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2015-07-04 20:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (60 votes), past polls