libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
GtkCRN::DrawingPanel Class Reference

A widget that allows to draw on it. More...

#include <GtkCRNDrawingPanel.h>

+ Inheritance diagram for GtkCRN::DrawingPanel:
+ Collaboration diagram for GtkCRN::DrawingPanel:

Public Member Functions

 DrawingPanel ()
 Constructor. More...
 
virtual ~DrawingPanel () override
 
Glib::RefPtr< Gtk::ActionGroup > get_actions ()
 Returns actions associated to the drawing panel. Valid actions are: More...
 
void set_zoom (double z)
 Sets the zoom level. More...
 
void clear ()
 Clears the panel. More...
 
Gdk::Color get_background () const
 Gets the background color. More...
 
void set_background (const Gdk::Color &col)
 Sets the background color. More...
 
Gdk::Color get_foreground () const
 Gets the foreground color. More...
 
void set_foreground (const Gdk::Color &col)
 Sets the foreground color. More...
 
Glib::RefPtr< Gdk::Pixbuf > create_image ()
 Renders the panel to a Pixbuf. More...
 

Detailed Description

A widget that allows to draw on it.

A widget for drawing. The user can adjust the colors of back- and foreground and the stroke thickness. The sketch can be exported to an image.

Definition at line 42 of file GtkCRNDrawingPanel.h.

Constructor & Destructor Documentation

DrawingPanel::DrawingPanel ( )

Constructor.

Constructor

Definition at line 33 of file GtkCRNDrawingPanel.cpp.

virtual GtkCRN::DrawingPanel::~DrawingPanel ( )
inlineoverridevirtual

Definition at line 47 of file GtkCRNDrawingPanel.h.

Member Function Documentation

void DrawingPanel::clear ( )

Clears the panel.

Clears the panel

Definition at line 101 of file GtkCRNDrawingPanel.cpp.

Glib::RefPtr< Gdk::Pixbuf > DrawingPanel::create_image ( )

Renders the panel to a Pixbuf.

Renders the panel to a Pixbuf

Returns
a Pixbuf containing what was drawn on the panel

Definition at line 168 of file GtkCRNDrawingPanel.cpp.

Glib::RefPtr<Gtk::ActionGroup> GtkCRN::DrawingPanel::get_actions ( )
inline

Returns actions associated to the drawing panel. Valid actions are:

  • drawing-panel-background
  • drawing-panel-foreground
  • drawing-panel-clear
  • drawing-panel-thickness-set
  • drawing-panel-thickness-plus
  • drawing-panel-thickness-minus

Definition at line 57 of file GtkCRNDrawingPanel.h.

Gdk::Color DrawingPanel::get_background ( ) const

Gets the background color.

Gets the background color

Returns
the background color

Definition at line 116 of file GtkCRNDrawingPanel.cpp.

Gdk::Color DrawingPanel::get_foreground ( ) const

Gets the foreground color.

Gets the foreground color

Returns
the foreground color

Definition at line 145 of file GtkCRNDrawingPanel.cpp.

void DrawingPanel::set_background ( const Gdk::Color &  col)

Sets the background color.

Sets the background color

Parameters
[in]colthe new background color

Definition at line 130 of file GtkCRNDrawingPanel.cpp.

void DrawingPanel::set_foreground ( const Gdk::Color &  col)

Sets the foreground color.

Sets the foreground color

Parameters
[in]colthe new foreground color

Definition at line 159 of file GtkCRNDrawingPanel.cpp.

void DrawingPanel::set_zoom ( double  z)

Sets the zoom level.

Changes the zoom

Exceptions
Glib::OptionErrornull or negative zoom
Parameters
[in]zthe new zoom value

Definition at line 90 of file GtkCRNDrawingPanel.cpp.


The documentation for this class was generated from the following files: