applp.CanvasImage module

class applp.CanvasImage(master, image, title='', ncoords=None, *args, **kwargs)[source]

Bases: Frame

This class is a tkinter frame where to put an image that can be manipulated.

Parameters:

a (int or float) – TODO.

_attr

TODO.

Type:

int or float

Examples

>>> from applp import CanvasImage
...
>>> instance = CanvasImage(TODO)
bkgd()[source]
property color_shape
property coords
delta = 1.1
property draw_func
property draw_kwargs
draw_shape = 'Rectangle'
drawing_corner = 10
get_coord(event=None)[source]

Getting coordinates of last drawn shape (x0,y0,x1,y1)

grid(*args, **kwargs)[source]

Grid the widget and initialize internal layout.

Calls place_widgets() after gridding to set up scrollbars, header, and canvas.

Parameters:
  • *args – Positional arguments forwarded to tk.Frame.grid().

  • **kwargs – Keyword arguments forwarded to tk.Frame.grid().

property image
imscale = 1.0
left_move(event=None)[source]

Draws shape while dragging mouse

left_press(event=None)[source]

Remember first coordinates of drawing

move_from(event)[source]

Remember previous coordinates for scrolling with the mouse

move_to(event)[source]

Drag (move) canvas to the new position

n_bkgd = 100
pack(*args, **kwargs)[source]

Pack the widget and initialize internal layout.

Calls place_widgets() after packing to set up scrollbars, header, and canvas.

Parameters:
  • *args – Positional arguments forwarded to tk.Frame.pack().

  • **kwargs – Keyword arguments forwarded to tk.Frame.pack().

paste_shape(event=None)[source]

Keep the last shape on canvas and resets a new shape

place(*args, **kwargs)[source]

Place the widget and initialize internal layout.

Calls place_widgets() after placing to set up scrollbars, header, and canvas.

Parameters:
  • *args – Positional arguments forwarded to tk.Frame.place().

  • **kwargs – Keyword arguments forwarded to tk.Frame.place().

place_widgets()[source]
pointer_exit(event)[source]
pointing(event)[source]
right_release(event=None)[source]

Makes new shape

scroll_x(*args)[source]

Scroll canvas horizontally and redraw the image

scroll_y(*args)[source]

Scroll canvas vertically and redraw the image

shaper_text()[source]
property shapes
show_image(event=None)[source]

Show image on the Canvas

title = ''
title_size = 16
update_bkgd(event=None)[source]
wheel(event)[source]

Zoom with mouse wheel

width_shape = 2