Table of Contents

Class Pixbuf

Namespace
GdkPixbuf
Assembly
GdkPixbuf-2.0.dll
public class Pixbuf : Object, IObject, INotifyPropertyChanged, IDisposable, Icon, LoadableIcon, IHandle, GTypeProvider
Inheritance
Pixbuf
Implements
Inherited Members

Constructors

Pixbuf(bool, params ConstructArgument[])

protected Pixbuf(bool owned, params ConstructArgument[] constructArguments)

Parameters

owned bool
constructArguments ConstructArgument[]

Pixbuf(IntPtr, bool)

protected Pixbuf(IntPtr ptr, bool ownedRef)

Parameters

ptr IntPtr
ownedRef bool

Fields

BitsPerSamplePropertyDefinition

public static readonly Property<int, Pixbuf> BitsPerSamplePropertyDefinition

Field Value

Property<int, Pixbuf>

ColorspacePropertyDefinition

public static readonly Property<Colorspace, Pixbuf> ColorspacePropertyDefinition

Field Value

Property<Colorspace, Pixbuf>

HasAlphaPropertyDefinition

public static readonly Property<bool, Pixbuf> HasAlphaPropertyDefinition

Field Value

Property<bool, Pixbuf>

HeightPropertyDefinition

public static readonly Property<int, Pixbuf> HeightPropertyDefinition

Field Value

Property<int, Pixbuf>

NChannelsPropertyDefinition

public static readonly Property<int, Pixbuf> NChannelsPropertyDefinition

Field Value

Property<int, Pixbuf>

PixelBytesPropertyDefinition

public static readonly Property<Bytes, Pixbuf> PixelBytesPropertyDefinition

Field Value

Property<Bytes, Pixbuf>

PixelsPropertyDefinition

public static readonly Property<IntPtr, Pixbuf> PixelsPropertyDefinition

Field Value

Property<IntPtr, Pixbuf>

RowstridePropertyDefinition

public static readonly Property<int, Pixbuf> RowstridePropertyDefinition

Field Value

Property<int, Pixbuf>

WidthPropertyDefinition

public static readonly Property<int, Pixbuf> WidthPropertyDefinition

Field Value

Property<int, Pixbuf>

Properties

BitsPerSample

public int BitsPerSample { get; }

Property Value

int

Colorspace

public Colorspace Colorspace { get; }

Property Value

Colorspace

HasAlpha

public bool HasAlpha { get; }

Property Value

bool

Height

public int Height { get; }

Property Value

int

NChannels

public int NChannels { get; }

Property Value

int

PixelBytes

public Bytes PixelBytes { get; }

Property Value

Bytes

Pixels

public IntPtr Pixels { get; }

Property Value

IntPtr

Rowstride

public int Rowstride { get; }

Property Value

int

Width

public int Width { get; }

Property Value

int

Methods

AddAlpha(bool, byte, byte, byte)

public Pixbuf AddAlpha(bool substituteColor, byte r, byte g, byte b)

Parameters

substituteColor bool
r byte
g byte
b byte

Returns

Pixbuf

ApplyEmbeddedOrientation()

[Version("2.12")]
public Pixbuf? ApplyEmbeddedOrientation()

Returns

Pixbuf

CalculateRowstride(Colorspace, bool, int, int, int)

[Version("2.36.8")]
public static int CalculateRowstride(Colorspace colorspace, bool hasAlpha, int bitsPerSample, int width, int height)

Parameters

colorspace Colorspace
hasAlpha bool
bitsPerSample int
width int
height int

Returns

int

Composite(Pixbuf, int, int, int, int, double, double, double, double, InterpType, int)

public void Composite(Pixbuf dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, InterpType interpType, int overallAlpha)

Parameters

dest Pixbuf
destX int
destY int
destWidth int
destHeight int
offsetX double
offsetY double
scaleX double
scaleY double
interpType InterpType
overallAlpha int

CompositeColor(Pixbuf, int, int, int, int, double, double, double, double, InterpType, int, int, int, int, uint, uint)

public void CompositeColor(Pixbuf dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, InterpType interpType, int overallAlpha, int checkX, int checkY, int checkSize, uint color1, uint color2)

Parameters

dest Pixbuf
destX int
destY int
destWidth int
destHeight int
offsetX double
offsetY double
scaleX double
scaleY double
interpType InterpType
overallAlpha int
checkX int
checkY int
checkSize int
color1 uint
color2 uint

CompositeColorSimple(int, int, InterpType, int, int, uint, uint)

public Pixbuf? CompositeColorSimple(int destWidth, int destHeight, InterpType interpType, int overallAlpha, int checkSize, uint color1, uint color2)

Parameters

destWidth int
destHeight int
interpType InterpType
overallAlpha int
checkSize int
color1 uint
color2 uint

Returns

Pixbuf

Copy()

public Pixbuf? Copy()

Returns

Pixbuf

CopyArea(int, int, int, int, Pixbuf, int, int)

public void CopyArea(int srcX, int srcY, int width, int height, Pixbuf destPixbuf, int destX, int destY)

Parameters

srcX int
srcY int
width int
height int
destPixbuf Pixbuf
destX int
destY int

CopyOptions(Pixbuf)

[Version("2.36")]
public bool CopyOptions(Pixbuf destPixbuf)

Parameters

destPixbuf Pixbuf

Returns

bool

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

Equal(Icon?)

public bool Equal(Icon? icon2)

Parameters

icon2 Icon

Returns

bool

Fill(uint)

public void Fill(uint pixel)

Parameters

pixel uint

Flip(bool)

[Version("2.6")]
public Pixbuf? Flip(bool horizontal)

Parameters

horizontal bool

Returns

Pixbuf

GetBitsPerSample()

public int GetBitsPerSample()

Returns

int

GetByteLength()

[Version("2.26")]
public nuint GetByteLength()

Returns

nuint

GetColorspace()

public Colorspace GetColorspace()

Returns

Colorspace

GetFileInfo(string, out int, out int)

[Version("2.4")]
public static PixbufFormat? GetFileInfo(string filename, out int width, out int height)

Parameters

filename string
width int
height int

Returns

PixbufFormat

GetFileInfoFinish(AsyncResult, out int, out int)

[Version("2.32")]
public static PixbufFormat? GetFileInfoFinish(AsyncResult asyncResult, out int width, out int height)

Parameters

asyncResult AsyncResult
width int
height int

Returns

PixbufFormat

GetGType()

public static Type GetGType()

Returns

Type

GetHasAlpha()

public bool GetHasAlpha()

Returns

bool

GetHeight()

public int GetHeight()

Returns

int

GetNChannels()

public int GetNChannels()

Returns

int

GetOption(string)

public string? GetOption(string key)

Parameters

key string

Returns

string

GetRowstride()

public int GetRowstride()

Returns

int

GetWidth()

public int GetWidth()

Returns

int

Hash()

public uint Hash()

Returns

uint

InitModules(string)

[Version("2.40")]
public static bool InitModules(string path)

Parameters

path string

Returns

bool

Initialize()

Does common initialization tasks. Wrapper and subclasses can override here to perform immediate initialization.

protected override void Initialize()

Load(int, out string, Cancellable?)

public InputStream Load(int size, out string type, Cancellable? cancellable)

Parameters

size int
type string
cancellable Cancellable

Returns

InputStream

LoadFinish(AsyncResult, out string)

public InputStream LoadFinish(AsyncResult res, out string type)

Parameters

res AsyncResult
type string

Returns

InputStream

New(Colorspace, bool, int, int, int)

public static Pixbuf? New(Colorspace colorspace, bool hasAlpha, int bitsPerSample, int width, int height)

Parameters

colorspace Colorspace
hasAlpha bool
bitsPerSample int
width int
height int

Returns

Pixbuf

NewFromBytes(Bytes, Colorspace, bool, int, int, int, int)

[Version("2.32")]
public static Pixbuf NewFromBytes(Bytes data, Colorspace colorspace, bool hasAlpha, int bitsPerSample, int width, int height, int rowstride)

Parameters

data Bytes
colorspace Colorspace
hasAlpha bool
bitsPerSample int
width int
height int
rowstride int

Returns

Pixbuf

NewFromFile(string)

public static Pixbuf? NewFromFile(string filename)

Parameters

filename string

Returns

Pixbuf

NewFromFileAtScale(string, int, int, bool)

[Version("2.6")]
public static Pixbuf? NewFromFileAtScale(string filename, int width, int height, bool preserveAspectRatio)

Parameters

filename string
width int
height int
preserveAspectRatio bool

Returns

Pixbuf

NewFromFileAtSize(string, int, int)

[Version("2.4")]
public static Pixbuf? NewFromFileAtSize(string filename, int width, int height)

Parameters

filename string
width int
height int

Returns

Pixbuf

NewFromInline(Span<byte>, bool)

public static Pixbuf NewFromInline(Span<byte> data, bool copyPixels)

Parameters

data Span<byte>
copyPixels bool

Returns

Pixbuf

NewFromResource(string)

[Version("2.26")]
public static Pixbuf? NewFromResource(string resourcePath)

Parameters

resourcePath string

Returns

Pixbuf

NewFromResourceAtScale(string, int, int, bool)

[Version("2.26")]
public static Pixbuf? NewFromResourceAtScale(string resourcePath, int width, int height, bool preserveAspectRatio)

Parameters

resourcePath string
width int
height int
preserveAspectRatio bool

Returns

Pixbuf

NewFromStream(InputStream, Cancellable?)

[Version("2.14")]
public static Pixbuf? NewFromStream(InputStream stream, Cancellable? cancellable)

Parameters

stream InputStream
cancellable Cancellable

Returns

Pixbuf

NewFromStreamAtScale(InputStream, int, int, bool, Cancellable?)

[Version("2.14")]
public static Pixbuf? NewFromStreamAtScale(InputStream stream, int width, int height, bool preserveAspectRatio, Cancellable? cancellable)

Parameters

stream InputStream
width int
height int
preserveAspectRatio bool
cancellable Cancellable

Returns

Pixbuf

NewFromStreamFinish(AsyncResult)

[Version("2.24")]
public static Pixbuf? NewFromStreamFinish(AsyncResult asyncResult)

Parameters

asyncResult AsyncResult

Returns

Pixbuf

NewFromXpmData(string[])

public static Pixbuf NewFromXpmData(string[] data)

Parameters

data string[]

Returns

Pixbuf

NewSubpixbuf(int, int, int, int)

public Pixbuf NewSubpixbuf(int srcX, int srcY, int width, int height)

Parameters

srcX int
srcY int
width int
height int

Returns

Pixbuf

ReadPixelBytes()

[Version("2.32")]
public Bytes ReadPixelBytes()

Returns

Bytes

ReadPixels()

[Version("2.32")]
public IntPtr ReadPixels()

Returns

IntPtr

Ref()

public Pixbuf Ref()

Returns

Pixbuf

RemoveOption(string)

[Version("2.36")]
public bool RemoveOption(string key)

Parameters

key string

Returns

bool

RotateSimple(PixbufRotation)

[Version("2.6")]
public Pixbuf? RotateSimple(PixbufRotation angle)

Parameters

angle PixbufRotation

Returns

Pixbuf

SaturateAndPixelate(Pixbuf, float, bool)

public void SaturateAndPixelate(Pixbuf dest, float saturation, bool pixelate)

Parameters

dest Pixbuf
saturation float
pixelate bool

SaveToStreamFinish(AsyncResult)

[Version("2.24")]
public static bool SaveToStreamFinish(AsyncResult asyncResult)

Parameters

asyncResult AsyncResult

Returns

bool

SaveToStreamv(OutputStream, string, string[]?, string[]?, Cancellable?)

[Version("2.36")]
public bool SaveToStreamv(OutputStream stream, string type, string[]? optionKeys, string[]? optionValues, Cancellable? cancellable)

Parameters

stream OutputStream
type string
optionKeys string[]
optionValues string[]
cancellable Cancellable

Returns

bool

Savev(string, string, string[]?, string[]?)

public bool Savev(string filename, string type, string[]? optionKeys, string[]? optionValues)

Parameters

filename string
type string
optionKeys string[]
optionValues string[]

Returns

bool

Scale(Pixbuf, int, int, int, int, double, double, double, double, InterpType)

public void Scale(Pixbuf dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, InterpType interpType)

Parameters

dest Pixbuf
destX int
destY int
destWidth int
destHeight int
offsetX double
offsetY double
scaleX double
scaleY double
interpType InterpType

ScaleSimple(int, int, InterpType)

public Pixbuf? ScaleSimple(int destWidth, int destHeight, InterpType interpType)

Parameters

destWidth int
destHeight int
interpType InterpType

Returns

Pixbuf

Serialize()

[Version("2.38")]
public Variant? Serialize()

Returns

Variant

SetOption(string, string)

[Version("2.2")]
public bool SetOption(string key, string value)

Parameters

key string
value string

Returns

bool

ToString()

[Version("2.20")]
public string? ToString()

Returns

string

Unref()

public void Unref()