MCPcopy Index your code
hub / github.com/RustPython/RustPython / copy

Method copy

Lib/tkinter/__init__.py:4303–4323  ·  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

4301 return self.tk.call(self.name, 'cget', '-' + key)
4302
4303 def copy(self, *, from_coords=None, zoom=None, subsample=None):
4304 """Return a new PhotoImage with the same image as this widget.
4305
4306 The FROM_COORDS option specifies a rectangular sub-region of the
4307 source image to be copied. It must be a tuple or a list of 1 to 4
4308 integers (x1, y1, x2, y2). (x1, y1) and (x2, y2) specify diagonally
4309 opposite corners of the rectangle. If x2 and y2 are not specified,
4310 the default value is the bottom-right corner of the source image.
4311 The pixels copied will include the left and top edges of the
4312 specified rectangle but not the bottom or right edges. If the
4313 FROM_COORDS option is not given, the default is the whole source
4314 image.
4315
4316 If SUBSAMPLE or ZOOM are specified, the image is transformed as in
4317 the subsample() or zoom() methods. The value must be a single
4318 integer or a pair of integers.
4319 """
4320 destImage = PhotoImage(master=self.tk)
4321 destImage.copy_replace(self, from_coords=from_coords,
4322 zoom=zoom, subsample=subsample)
4323 return destImage
4324
4325 def zoom(self, x, y='', *, from_coords=None):
4326 """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