Class Pixbuf
- Namespace
- GdkPixbuf
- Assembly
- GdkPixbuf-2.0.dll
public class Pixbuf : Object, Icon, LoadableIcon, NativeObject, IDisposable, GTypeProvider, InstanceFactory
- Inheritance
-
Pixbuf
- Implements
- Inherited Members
Constructors
Pixbuf(params ConstructArgument[])
[Obsolete("Regular C# constructors on native classes will be removed in a future version. Please see the linked documentation for more details. It contains scenarios and possible solutions to prepare for the upcoming changes.", DiagnosticId = "GirCore1007", UrlFormat = "https://gircore.github.io/docs/integration/diagnostic/1007.html")]
public Pixbuf(params ConstructArgument[] constructArguments)
Parameters
constructArgumentsConstructArgument[]
Pixbuf(CreationData)
[Obsolete("This constructor is a workaround to keep legacy APIs alive. Do not use it.")]
protected Pixbuf(CreationData data)
Parameters
dataCreationData
Pixbuf(PixbufHandle)
protected Pixbuf(PixbufHandle handle)
Parameters
handlePixbufHandle
Fields
BitsPerSamplePropertyDefinition
public static readonly Property<int, Pixbuf> BitsPerSamplePropertyDefinition
Field Value
ColorspacePropertyDefinition
public static readonly Property<Colorspace, Pixbuf> ColorspacePropertyDefinition
Field Value
HasAlphaPropertyDefinition
public static readonly Property<bool, Pixbuf> HasAlphaPropertyDefinition
Field Value
HeightPropertyDefinition
public static readonly Property<int, Pixbuf> HeightPropertyDefinition
Field Value
NChannelsPropertyDefinition
public static readonly Property<int, Pixbuf> NChannelsPropertyDefinition
Field Value
PixelBytesPropertyDefinition
public static readonly Property<Bytes, Pixbuf> PixelBytesPropertyDefinition
Field Value
PixelsPropertyDefinition
public static readonly Property<nint, Pixbuf> PixelsPropertyDefinition
Field Value
RowstridePropertyDefinition
public static readonly Property<int, Pixbuf> RowstridePropertyDefinition
Field Value
WidthPropertyDefinition
public static readonly Property<int, Pixbuf> WidthPropertyDefinition
Field Value
Properties
BitsPerSample
public int BitsPerSample { get; }
Property Value
Colorspace
public Colorspace Colorspace { get; }
Property Value
HasAlpha
public bool HasAlpha { get; }
Property Value
Height
public int Height { get; }
Property Value
NChannels
public int NChannels { get; }
Property Value
PixelBytes
public Bytes PixelBytes { get; }
Property Value
Pixels
public nint Pixels { get; }
Property Value
Rowstride
public int Rowstride { get; }
Property Value
Width
public int Width { get; }
Property Value
Methods
AddAlpha(bool, byte, byte, byte)
public Pixbuf? AddAlpha(bool substituteColor, byte r, byte g, byte b)
Parameters
Returns
ApplyEmbeddedOrientation()
[Version("2.12")]
public Pixbuf? ApplyEmbeddedOrientation()
Returns
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
colorspaceColorspacehasAlphaboolbitsPerSampleintwidthintheightint
Returns
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
destPixbufdestXintdestYintdestWidthintdestHeightintoffsetXdoubleoffsetYdoublescaleXdoublescaleYdoubleinterpTypeInterpTypeoverallAlphaint
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
destPixbufdestXintdestYintdestWidthintdestHeightintoffsetXdoubleoffsetYdoublescaleXdoublescaleYdoubleinterpTypeInterpTypeoverallAlphaintcheckXintcheckYintcheckSizeintcolor1uintcolor2uint
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
destWidthintdestHeightintinterpTypeInterpTypeoverallAlphaintcheckSizeintcolor1uintcolor2uint
Returns
Copy()
public Pixbuf? Copy()
Returns
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
CopyOptions(Pixbuf)
[Version("2.36")]
public bool CopyOptions(Pixbuf destPixbuf)
Parameters
destPixbufPixbuf
Returns
Equal(Icon?)
public bool Equal(Icon? icon2)
Parameters
icon2Icon
Returns
Fill(uint)
public void Fill(uint pixel)
Parameters
pixeluint
Flip(bool)
[Version("2.6")]
public Pixbuf? Flip(bool horizontal)
Parameters
horizontalbool
Returns
GetBitsPerSample()
public int GetBitsPerSample()
Returns
GetByteLength()
[Version("2.26")]
public nuint GetByteLength()
Returns
GetColorspace()
public Colorspace GetColorspace()
Returns
GetFileInfo(string, out int, out int)
[Version("2.4")]
public static PixbufFormat? GetFileInfo(string filename, out int width, out int height)
Parameters
Returns
GetFileInfoFinish(AsyncResult, out int, out int)
[Version("2.32")]
public static PixbufFormat? GetFileInfoFinish(AsyncResult asyncResult, out int width, out int height)
Parameters
asyncResultAsyncResultwidthintheightint
Returns
GetGType()
public static Type GetGType()
Returns
GetHasAlpha()
public bool GetHasAlpha()
Returns
GetHeight()
public int GetHeight()
Returns
GetNChannels()
public int GetNChannels()
Returns
GetOption(string)
public string? GetOption(string key)
Parameters
keystring
Returns
GetRowstride()
public int GetRowstride()
Returns
GetWidth()
public int GetWidth()
Returns
Hash()
public uint Hash()
Returns
InitModules(string)
[Version("2.40")]
public static bool InitModules(string path)
Parameters
pathstring
Returns
Load(int, out string, Cancellable?)
public InputStream Load(int size, out string type, Cancellable? cancellable)
Parameters
sizeinttypestringcancellableCancellable
Returns
LoadFinish(AsyncResult, out string)
public InputStream LoadFinish(AsyncResult res, out string type)
Parameters
resAsyncResulttypestring
Returns
New(Colorspace, bool, int, int, int)
public static Pixbuf? New(Colorspace colorspace, bool hasAlpha, int bitsPerSample, int width, int height)
Parameters
colorspaceColorspacehasAlphaboolbitsPerSampleintwidthintheightint
Returns
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
Returns
NewFromFile(string)
public static Pixbuf? NewFromFile(string filename)
Parameters
filenamestring
Returns
NewFromFileAtScale(string, int, int, bool)
[Version("2.6")]
public static Pixbuf? NewFromFileAtScale(string filename, int width, int height, bool preserveAspectRatio)
Parameters
Returns
NewFromFileAtSize(string, int, int)
[Version("2.4")]
public static Pixbuf? NewFromFileAtSize(string filename, int width, int height)
Parameters
Returns
NewFromInline(Span<byte>, bool)
public static Pixbuf NewFromInline(Span<byte> data, bool copyPixels)
Parameters
Returns
NewFromPointer(nint, bool)
Creates a new managed Pixbuf instance for a given pointer.
public static Pixbuf NewFromPointer(nint ptr, bool ownsHandle)
Parameters
Returns
NewFromResource(string)
[Version("2.26")]
public static Pixbuf? NewFromResource(string resourcePath)
Parameters
resourcePathstring
Returns
NewFromResourceAtScale(string, int, int, bool)
[Version("2.26")]
public static Pixbuf? NewFromResourceAtScale(string resourcePath, int width, int height, bool preserveAspectRatio)
Parameters
Returns
NewFromStream(InputStream, Cancellable?)
[Version("2.14")]
public static Pixbuf? NewFromStream(InputStream stream, Cancellable? cancellable)
Parameters
streamInputStreamcancellableCancellable
Returns
NewFromStreamAtScale(InputStream, int, int, bool, Cancellable?)
[Version("2.14")]
public static Pixbuf? NewFromStreamAtScale(InputStream stream, int width, int height, bool preserveAspectRatio, Cancellable? cancellable)
Parameters
streamInputStreamwidthintheightintpreserveAspectRatioboolcancellableCancellable
Returns
NewFromStreamFinish(AsyncResult)
[Version("2.24")]
public static Pixbuf? NewFromStreamFinish(AsyncResult asyncResult)
Parameters
asyncResultAsyncResult
Returns
NewFromXpmData(string[])
public static Pixbuf? NewFromXpmData(string[] data)
Parameters
datastring[]
Returns
NewSubpixbuf(int, int, int, int)
public Pixbuf NewSubpixbuf(int srcX, int srcY, int width, int height)
Parameters
Returns
NewWithProperties(ConstructArgument[])
Creates a new Pixbuf and sets the properties specified by the construct arguments.
public static Pixbuf NewWithProperties(ConstructArgument[] constructArguments)
Parameters
constructArgumentsConstructArgument[]The properties to set.
Returns
ReadPixelBytes()
[Version("2.32")]
public Bytes ReadPixelBytes()
Returns
ReadPixels()
[Version("2.32")]
public nint ReadPixels()
Returns
Ref()
public Pixbuf Ref()
Returns
RemoveOption(string)
[Version("2.36")]
public bool RemoveOption(string key)
Parameters
keystring
Returns
RotateSimple(PixbufRotation)
[Version("2.6")]
public Pixbuf? RotateSimple(PixbufRotation angle)
Parameters
anglePixbufRotation
Returns
SaturateAndPixelate(Pixbuf, float, bool)
public void SaturateAndPixelate(Pixbuf dest, float saturation, bool pixelate)
Parameters
SaveToStreamFinish(AsyncResult)
[Version("2.24")]
public static bool SaveToStreamFinish(AsyncResult asyncResult)
Parameters
asyncResultAsyncResult
Returns
SaveToStreamv(OutputStream, string, string[]?, string[]?, Cancellable?)
[Version("2.36")]
public bool SaveToStreamv(OutputStream stream, string type, string[]? optionKeys, string[]? optionValues, Cancellable? cancellable)
Parameters
streamOutputStreamtypestringoptionKeysstring[]optionValuesstring[]cancellableCancellable
Returns
Savev(string, string, string[]?, string[]?)
public bool Savev(string filename, string type, string[]? optionKeys, string[]? optionValues)
Parameters
Returns
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
destPixbufdestXintdestYintdestWidthintdestHeightintoffsetXdoubleoffsetYdoublescaleXdoublescaleYdoubleinterpTypeInterpType
ScaleSimple(int, int, InterpType)
public Pixbuf? ScaleSimple(int destWidth, int destHeight, InterpType interpType)
Parameters
destWidthintdestHeightintinterpTypeInterpType
Returns
Serialize()
[Version("2.38")]
public Variant? Serialize()
Returns
SetOption(string, string)
[Version("2.2")]
public bool SetOption(string key, string value)
Parameters
Returns
ToString()
[Version("2.20")]
public string? ToString()
Returns
Unref()
public void Unref()