MCPcopy Index your code
hub / github.com/python/cpython / copy

Method copy

Lib/tkinter/__init__.py:4426–4446  ·  view source on GitHub ↗

Return a new PhotoImage with the same image as this widget. The FROM_COORDS option specifies a rectangular sub-region of the source image to be copied. It must be a tuple or a list of 1 to 4 integers (x1, y1, x2, y2). (x1, y1) and (x2, y2) specify diagonally opposit

(self, *, from_coords=None, zoom=None, subsample=None)

Source from the content-addressed store, hash-verified

4424 return self.tk.call(self.name, 'cget', '-' + key)
4425
4426 def copy(self, *, from_coords=None, zoom=None, subsample=None):
4427 """Return a new PhotoImage with the same image as this widget.
4428
4429 The FROM_COORDS option specifies a rectangular sub-region of the
4430 source image to be copied. It must be a tuple or a list of 1 to 4
4431 integers (x1, y1, x2, y2). (x1, y1) and (x2, y2) specify diagonally
4432 opposite corners of the rectangle. If x2 and y2 are not specified,
4433 the default value is the bottom-right corner of the source image.
4434 The pixels copied will include the left and top edges of the
4435 specified rectangle but not the bottom or right edges. If the
4436 FROM_COORDS option is not given, the default is the whole source
4437 image.
4438
4439 If SUBSAMPLE or ZOOM are specified, the image is transformed as in
4440 the subsample() or zoom() methods. The value must be a single
4441 integer or a pair of integers.
4442 """
4443 destImage = PhotoImage(master=self.tk)
4444 destImage.copy_replace(self, from_coords=from_coords,
4445 zoom=zoom, subsample=subsample)
4446 return destImage
4447
4448 def zoom(self, x, y='', *, from_coords=None):
4449 """Return a new PhotoImage with the same image as this widget

Callers 2

zoomMethod · 0.95
subsampleMethod · 0.95

Calls 2

copy_replaceMethod · 0.95
PhotoImageClass · 0.85

Tested by

no test coverage detected