Texture
Object Hierarchy:
Gdk.Texture
Gdk.Texture
Gdk.Texture
GLib.Object
GLib.Object
GLib.Object->Gdk.Texture
Gdk.Paintable
Gdk.Paintable
Gdk.Paintable->Gdk.Texture
GLib.Icon
GLib.Icon
GLib.Icon->Gdk.Texture
GLib.LoadableIcon
GLib.LoadableIcon
GLib.LoadableIcon->Gdk.Texture
Description:
[
CCode ( type_id =
"gdk_texture_get_type ()" ) ]
public abstract class Texture :
Object ,
Paintable ,
Icon ,
LoadableIcon
`GdkTexture` is the basic element used to refer to pixel data.
It is primarily meant for pixel data that will not change over multiple frames, and will be used for a long time.
There are various ways to create `GdkTexture` objects from a [[email protected] ], or a Cairo surface, or other pixel data.
The ownership of the pixel data is transferred to the `GdkTexture` instance; you can only make a copy of it, via [
[email protected] ].
`GdkTexture` is an immutable object: That means you cannot change anything about it other than increasing the reference count via [
[email protected] ], and consequently, it is a thread-safe object.
Content:
Properties:
public int height { get ; construct ; }
The height of the texture, in pixels.
public int width { get ; construct ; }
The width of the texture, in pixels.
Static methods:
public static Texture for_pixbuf (Pixbuf pixbuf)
Creates a new texture object representing the `GdkPixbuf`.
public static Texture from_bytes (Bytes bytes) throws Error
Creates a new texture by loading an image from memory,
public static Texture from_file (File file) throws Error
Creates a new texture by loading an image from a file.
public static Texture from_filename (string path) throws Error
Creates a new texture by loading an image from a file.
public static Texture from_resource (string resource_path)
Creates a new texture by loading an image from a resource.
Creation methods:
Methods:
public void download (uint8 [] data, size_t stride)
Downloads the this into local
memory.
public int get_height ()
Returns the height of the this , in
pixels.
public int get_width ()
Returns the width of this , in
pixels.
public bool save_to_png (string filename)
Store the given this to the
filename
as a PNG file.
public Bytes save_to_png_bytes ()
Store the given this in memory as a
PNG file.
public bool save_to_tiff (string filename)
Store the given this to the
filename
as a TIFF file.
public Bytes save_to_tiff_bytes ()
Store the given this in memory as a
TIFF file.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Gdk.Paintable
All known members inherited from interface GLib.Icon
deserialize
equal
from_tokens
hash
new_for_string
serialize
All known members inherited from interface GLib.LoadableIcon