|
class gtk.gdk.Image( |
The gtk.gdk.Image
type
represents an area for drawing graphics. It has now been superseded to a
large extent by the much more flexible RGB methods (see gtk.gdk.Drawable
).
gtk.gdk.Image(type
, visual
, width
, height
)
| a gtk.gdk.Image
type |
| a gtk.gdk.Visual |
| the width in pixels of the image |
| the height in pixels of the image |
Returns : | a new gtk.gdk.Image
object |
Creates a new gtk.gdk.Image
object
of the specified type
, width
and height
and using the gtk.gdk.Visual
specified by visual
. The value of
type
must be one of:
| The original X image type, which is quite slow since the image has to be transferred from the client to the server to display it. |
| A faster image type, which uses shared memory to transfer the image data between client and server. However this will only be available if client and server are on the same machine and the shared memory extension is supported by the server. |
| Specifies that gtk.gdk.IMAGE_SHARED should be tried first, and if that fails then gtk.gdk.IMAGE_NORMAL will be used. |
Usually using gtk.gdk.IMAGE_FASTEST
is the best
choice.
def put_pixel(x
, y
, pixel
)
| the x coordinate of the pixel to set. |
| the y coordinate of the pixel to set. |
| the pixel value to set. |
The put_pixel
() method sets the value
of the pixel in the image at the location specified by
x
and y
to the value specified
by pixel
.
def get_pixel(x
, y
)
| the x coordinate of the pixel to get. |
| the y coordinate of the pixel to get. |
Returns : | the pixel value at the image location |
The get_pixel
() method returns the
value of the pixel at the image location specified by
x
and y
.
def set_colormap(colormap
)
| a gtk.gdk.Colormap |
The set_colormap
() method sets the
colormap for the image to the specified colormap
.
Normally there's no need to use this method since images are created with
the correct colormap if you get the image from a drawable. If you create the
image from scratch, use the colormap of the drawable you intend to render
the image to.
def get_colormap()
Returns : | the colormap for the image |
The get_colormap
() method returns the
colormap for a given image, if it exists. An image will have a colormap if
the drawable from which it was created has a colormap, or if a colormap was
set explicitly with the set_colormap
()
method.
© manpagez.com 2000-2024 Individual documents may contain additional copyright information.