Re: Gtk2::PrintOperation



This should work:


$op->signal_connect( draw_page => sub {
  my ($op, $context) = @_;

  my $cr = $context->get_cairo_context;
  
  #load pixbuf from file
  my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( 'filename.png' );

  #set source pixbuf
  Gtk2::Gdk::Cairo::Context::set_source_pixbuf( $cr, $pixbuf, 0, 0 );
  
  #paint
  $cr->paint;

});



Regards
Mario




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]