2003-02-12 01:57:20 +00:00
<Type Name= "PixbufLoader" FullName= "Gdk.PixbufLoader" >
2003-02-15 03:08:25 +00:00
<TypeSignature Language= "C#" Value= "public class PixbufLoader : GLib.Object, IWrapper, IDisposable" Maintainer= "auto" />
2003-02-12 01:57:20 +00:00
<AssemblyInfo >
<AssemblyName > gdk-sharp</AssemblyName>
2003-12-24 01:35:30 +00:00
<AssemblyPublicKey >
</AssemblyPublicKey>
2003-02-12 01:57:20 +00:00
<AssemblyVersion > 0.0.0.0</AssemblyVersion>
2003-10-28 00:48:23 +00:00
<AssemblyCulture > neutral</AssemblyCulture>
2003-02-12 01:57:20 +00:00
<Attributes />
</AssemblyInfo>
2003-02-23 07:26:30 +00:00
<ThreadSafetyStatement > Gtk# is thread aware, but not thread safe; See the <link location= "node:gtk-sharp/programming/threads" > Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
2003-02-12 01:57:20 +00:00
<Docs >
2004-04-10 22:07:38 +00:00
<summary >
<para > PixbufLoader is a 'passive' pixbuf loader. It's not actively read pix buf data, but 'listen' for incoming data instead. It's useful in a case where you want to read the image data in small chunks. Typical use of PixbufLoader is when you want to read a very large image data or reading image from a slow media (such as a slow network connection).</para>
<para >
You can see the "Images" section of GtkDemo to learn how to use PixbufLoader.
</para>
</summary>
2004-08-09 20:54:25 +00:00
<remarks >
<example >
<code lang= "C#" >
using System;
using System.IO;
using Gtk;
using Gdk;
namespace GtkDemo
{
public class PixbufLoaderSample : Gtk.Window
{
static Gdk.PixbufLoader pixbufLoader;
private uint timeout_id;
private static Gtk.Image progressiveImage;
private VBox vbox;
BinaryReader imageStream;
static void Main ()
{
Application.Init ();
new PixbufLoaderSample ();
Application.Run ();
}
public PixbufLoaderSample () : base ("images")
{
this.DeleteEvent += new DeleteEventHandler (WindowDelete);
this.BorderWidth = 8;
vbox = new VBox (false, 8);
vbox.BorderWidth = 8;
this.Add (vbox);
Label label = new Gtk.Label ("Progressive image loading");
label.UseMarkup = true;
vbox.PackStart (label);
Gtk.Frame frame = new Gtk.Frame ();
frame.ShadowType = ShadowType.In;
Alignment alignment = new Alignment (0.5f, 0.5f, 0f, 0f);
alignment.Add (frame);
vbox.PackStart (alignment, false, false, 0);
// Create an empty image for now; the progressive loader
// will create the pixbuf and fill it in.
progressiveImage = new Gtk.Image ();
frame.Add (progressiveImage);
StartProgressiveLoading ();
this.ShowAll ();
}
private void WindowDelete (object o, DeleteEventArgs args)
{
this.Hide ();
this.Destroy ();
args.RetVal = true;
}
private void StartProgressiveLoading ()
{
/* This is obviously totally contrived (we slow down loading
* on purpose to show how incremental loading works).
* The real purpose of incremental loading is the case where
* you are reading data from a slow source such as the network.
* The timeout simply simulates a slow data source by inserting
* pauses in the reading process.
*/
timeout_id = GLib.Timeout.Add (150, new GLib.TimeoutHandler (ProgressiveTimeout));
}
private bool ProgressiveTimeout ()
{
if (imageStream == null) {
// note you need to provide your own image
// at that location to run this sample
imageStream = new BinaryReader (new StreamReader ("images/alphatest.png").BaseStream);
pixbufLoader = new Gdk.PixbufLoader ();
pixbufLoader.AreaPrepared += new EventHandler (ProgressivePreparedCallback);
pixbufLoader.AreaUpdated += new AreaUpdatedHandler (ProgressiveUpdatedCallback);
}
if (imageStream.PeekChar () != -1) {
byte[] bytes = imageStream.ReadBytes (256);
pixbufLoader.Write (bytes, (uint) bytes.Length);
return true; // leave the timeout active
}
else {
imageStream.Close ();
return false; // removes the timeout
}
}
static void ProgressivePreparedCallback (object obj, EventArgs args)
{
Gdk.Pixbuf pixbuf = pixbufLoader.Pixbuf;
pixbuf.Fill (0xaaaaaaff);
progressiveImage.FromPixbuf = pixbuf;
}
static void ProgressiveUpdatedCallback (object obj, AreaUpdatedArgs args)
{
progressiveImage.QueueDraw ();
}
}
}
</code>
</example>
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
<Base >
<BaseTypeName > GLib.Object</BaseTypeName>
</Base>
<Interfaces >
<Interface >
<InterfaceName > GLib.IWrapper</InterfaceName>
</Interface>
<Interface >
<InterfaceName > System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes />
<Members >
<Member MemberName= "Write" >
2005-03-10 22:15:07 +00:00
<MemberSignature Language= "C#" Value= "public bool Write (byte [] buf, ulong count);" />
2003-02-12 01:57:20 +00:00
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
<Parameters >
2005-03-10 22:15:07 +00:00
<Parameter Name= "buf" Type= "System.Byte[]" />
<Parameter Name= "count" Type= "System.UInt64" />
2003-09-17 21:56:59 +00:00
</Parameters>
2003-02-12 01:57:20 +00:00
<Docs >
2004-04-10 22:07:38 +00:00
<summary > Parses the next count bytes of image data from buffer buf.</summary>
<param name= "buf" > array of bytes buffer to parse.</param>
<param name= "count" > number of bytes to parse.</param>
<returns > returns true if data was parsed and loaded succesfully.</returns>
<remarks >
<para > If the return value is false, the PixbufLoader will be closed.</para>
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "Close" >
<MemberSignature Language= "C#" Value= "public bool Close ();" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-04-10 22:07:38 +00:00
<summary > Closes the loader.</summary>
<returns > returns true on successful close and false on error.</returns>
<remarks > During the close, PixbufLoader will parse any data that has not been parsed. If the data is incomplete or corrupted, this method will return false.</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "Finalize" >
2003-10-13 22:55:58 +00:00
<MemberSignature Language= "C#" Value= "protected override void Finalize ();" />
2003-02-12 01:57:20 +00:00
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-23 07:26:30 +00:00
<summary > Disposes the resources associated with the object.</summary>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public PixbufLoader (IntPtr raw);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
2003-09-17 21:56:59 +00:00
<Parameter Name= "raw" Type= "System.IntPtr" />
</Parameters>
2003-02-12 01:57:20 +00:00
<Docs >
2003-02-23 07:26:30 +00:00
<summary > Internal constructor</summary>
<param name= "raw" > Pointer to the C object.</param>
<returns > An instance of PixbufLoader, wrapping the C object.</returns>
<remarks >
<para > This is an internal constructor, and should not be used by user code.</para>
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public PixbufLoader ();" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs >
2004-08-09 20:54:25 +00:00
<summary > Default constructor</summary>
<returns > an object of type <see cref= "T:Gdk.PixbufLoader" /> </returns>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "Pixbuf" >
<MemberSignature Language= "C#" Value= "public Gdk.Pixbuf Pixbuf { get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > Gdk.Pixbuf</ReturnType>
</ReturnValue>
<Docs >
2004-08-09 20:54:25 +00:00
<summary > The Pixbuf that is being loaded.</summary>
<returns > an object of type <see cref= "T:Gdk.Pixbuf" /> </returns>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "Animation" >
<MemberSignature Language= "C#" Value= "public Gdk.PixbufAnimation Animation { get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > Gdk.PixbufAnimation</ReturnType>
</ReturnValue>
<Docs >
<summary > To be added</summary>
2004-08-09 20:54:25 +00:00
<returns > an object of type <see cref= "T:Gdk.PixbufAnimation" /> </returns>
2003-02-12 01:57:20 +00:00
<remarks > To be added</remarks>
</Docs>
</Member>
<Member MemberName= "AreaPrepared" >
<MemberSignature Language= "C#" Value= "public event EventHandler AreaPrepared;" />
<MemberType > Event</MemberType>
2003-09-17 21:56:59 +00:00
<ReturnValue >
<ReturnType > System.EventHandler</ReturnType>
</ReturnValue>
2003-02-12 01:57:20 +00:00
<Parameters />
<Docs >
2004-08-09 20:54:25 +00:00
<summary > Emitted when the area of the PixbufLoader is prepared.</summary>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "AreaUpdated" >
2004-02-25 23:39:06 +00:00
<MemberSignature Language= "C#" Value= "public event Gdk.AreaUpdatedHandler AreaUpdated;" />
2003-02-12 01:57:20 +00:00
<MemberType > Event</MemberType>
2003-09-17 21:56:59 +00:00
<ReturnValue >
2004-02-25 23:39:06 +00:00
<ReturnType > Gdk.AreaUpdatedHandler</ReturnType>
2003-09-17 21:56:59 +00:00
</ReturnValue>
2003-02-12 01:57:20 +00:00
<Parameters />
<Docs >
2004-08-09 20:54:25 +00:00
<summary > Emitted when the area of the PixbufLoader is updated with data.</summary>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "Closed" >
<MemberSignature Language= "C#" Value= "public event EventHandler Closed;" />
<MemberType > Event</MemberType>
2003-09-17 21:56:59 +00:00
<ReturnValue >
<ReturnType > System.EventHandler</ReturnType>
</ReturnValue>
2003-02-12 01:57:20 +00:00
<Parameters />
<Docs >
2004-08-09 20:54:25 +00:00
<summary > Emitted when the PixbufLoader is closed.</summary>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
2003-07-17 06:38:40 +00:00
<Member MemberName= "Format" >
<MemberSignature Language= "C#" Value= "public Gdk.PixbufFormat Format { get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > Gdk.PixbufFormat</ReturnType>
</ReturnValue>
<Docs >
<summary > To be added</summary>
<returns > a <see cref= "T:Gdk.PixbufFormat" /> </returns>
<remarks > To be added</remarks>
</Docs>
</Member>
<Member MemberName= "SizePrepared" >
2004-02-25 23:39:06 +00:00
<MemberSignature Language= "C#" Value= "public event Gdk.SizePreparedHandler SizePrepared;" />
2003-07-17 06:38:40 +00:00
<MemberType > Event</MemberType>
2003-09-17 21:56:59 +00:00
<ReturnValue >
2004-02-25 23:39:06 +00:00
<ReturnType > Gdk.SizePreparedHandler</ReturnType>
2003-09-17 21:56:59 +00:00
</ReturnValue>
2003-07-17 06:38:40 +00:00
<Parameters />
<Docs >
2004-08-09 20:54:25 +00:00
<summary > Emitted when the PixbufLoader has prepared its size.</summary>
<remarks />
2003-07-17 06:38:40 +00:00
</Docs>
</Member>
<Member MemberName= "SetSize" >
<MemberSignature Language= "C#" Value= "public void SetSize (int width, int height);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters >
2003-09-17 21:56:59 +00:00
<Parameter Name= "width" Type= "System.Int32" />
<Parameter Name= "height" Type= "System.Int32" />
</Parameters>
2003-07-17 06:38:40 +00:00
<Docs >
2004-08-09 20:54:25 +00:00
<summary > Set the size of the image that will be loaded.</summary>
2003-07-17 06:38:40 +00:00
<param name= "width" > a <see cref= "T:System.Int32" /> </param>
<param name= "height" > a <see cref= "T:System.Int32" /> </param>
2004-08-09 20:54:25 +00:00
<remarks />
2003-07-17 06:38:40 +00:00
</Docs>
</Member>
2003-12-24 01:35:30 +00:00
<Member MemberName= "GType" >
<MemberSignature Language= "C#" Value= "public static GLib.GType GType { get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > GLib.GType</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-06-21 20:14:42 +00:00
<summary > GType Property.</summary>
2003-12-24 01:35:30 +00:00
<returns > a <see cref= "T:GLib.GType" /> </returns>
2004-06-21 20:14:42 +00:00
<remarks > Returns the native <see cref= "T:GLib.GType" /> value for <see cref= "T:Gdk.PixbufLoader" /> .</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= "OnClosed" >
<MemberSignature Language= "C#" Value= "protected virtual void OnClosed ();" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-06-15 15:41:25 +00:00
<summary > Default handler for the <see cref= "M:Gdk.PixbufLoader.Closed" /> event.</summary>
<remarks > Override this method in a subclass to provide a default handler for the <see cref= "M:Gdk.PixbufLoader.Closed" /> event.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= "OnSizePrepared" >
<MemberSignature Language= "C#" Value= "protected virtual void OnSizePrepared (int width, int height);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters >
<Parameter Name= "width" Type= "System.Int32" />
<Parameter Name= "height" Type= "System.Int32" />
</Parameters>
<Docs >
2004-06-15 15:41:25 +00:00
<summary > Default handler for the <see cref= "M:Gdk.PixbufLoader.SizePrepared" /> event.</summary>
2003-12-24 01:35:30 +00:00
<param name= "width" > a <see cref= "T:System.Int32" /> </param>
<param name= "height" > a <see cref= "T:System.Int32" /> </param>
2004-06-15 15:41:25 +00:00
<remarks > Override this method in a subclass to provide a default handler for the <see cref= "M:Gdk.PixbufLoader.SizePrepared" /> event.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= "OnAreaUpdated" >
<MemberSignature Language= "C#" Value= "protected virtual void OnAreaUpdated (int x, int y, int width, int height);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters >
<Parameter Name= "x" Type= "System.Int32" />
<Parameter Name= "y" Type= "System.Int32" />
<Parameter Name= "width" Type= "System.Int32" />
<Parameter Name= "height" Type= "System.Int32" />
</Parameters>
<Docs >
2004-06-15 15:41:25 +00:00
<summary > Default handler for the <see cref= "M:Gdk.PixbufLoader.AreaUpdated" /> event.</summary>
2003-12-24 01:35:30 +00:00
<param name= "x" > a <see cref= "T:System.Int32" /> </param>
<param name= "y" > a <see cref= "T:System.Int32" /> </param>
<param name= "width" > a <see cref= "T:System.Int32" /> </param>
<param name= "height" > a <see cref= "T:System.Int32" /> </param>
2004-06-15 15:41:25 +00:00
<remarks > Override this method in a subclass to provide a default handler for the <see cref= "M:Gdk.PixbufLoader.AreaUpdated" /> event.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= "OnAreaPrepared" >
<MemberSignature Language= "C#" Value= "protected virtual void OnAreaPrepared ();" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-06-15 15:41:25 +00:00
<summary > Default handler for the <see cref= "M:Gdk.PixbufLoader.AreaPrepared" /> event.</summary>
<remarks > Override this method in a subclass to provide a default handler for the <see cref= "M:Gdk.PixbufLoader.AreaPrepared" /> event.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "protected PixbufLoader (GLib.GType gtype);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
<Parameter Name= "gtype" Type= "GLib.GType" />
</Parameters>
<Docs >
2004-06-21 20:33:11 +00:00
<summary > Protected Constructor.</summary>
2003-12-24 01:35:30 +00:00
<param name= "gtype" > a <see cref= "T:GLib.GType" /> </param>
<returns > a <see cref= "T:Gdk.PixbufLoader" /> </returns>
2004-06-21 20:33:11 +00:00
<remarks > Chain to this constructor if you have manually registered a native <see cref= "T:GLib.GType" /> value for your subclass.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
2004-08-24 23:29:26 +00:00
<Member MemberName= "Write" >
<MemberSignature Language= "C#" Value= "public bool Write (byte [] bytes);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
<Parameters >
<Parameter Name= "bytes" Type= "System.Byte[]" />
</Parameters>
<Docs >
<summary > Parses the bytes into the image data.</summary>
<param name= "bytes" > a <see cref= "T:System.Byte" /> </param>
<returns > a <see cref= "T:System.Boolean" /> </returns>
<remarks > This is an overload to <see cref= "M:Gdk.PixbufLoader.Write(System.Byte[],System.UInt32)" /> , which determines the length automatically.</remarks>
</Docs>
</Member>
2005-01-24 18:25:02 +00:00
<Member MemberName= "NewWithType" >
<MemberSignature Language= "C#" Value= "public static Gdk.PixbufLoader NewWithType (string image_type);" />
2004-11-05 19:03:16 +00:00
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > Gdk.PixbufLoader</ReturnType>
</ReturnValue>
<Parameters >
2005-01-24 18:25:02 +00:00
<Parameter Name= "image_type" Type= "System.String" />
2004-11-05 19:03:16 +00:00
</Parameters>
<Docs >
<summary > To be added</summary>
2005-01-24 18:25:02 +00:00
<param name= "image_type" > a <see cref= "T:System.String" /> </param>
2004-11-05 19:03:16 +00:00
<returns > a <see cref= "T:Gdk.PixbufLoader" /> </returns>
<remarks > To be added</remarks>
</Docs>
</Member>
2005-01-24 18:25:02 +00:00
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public PixbufLoader (string mime_type);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
2004-11-05 19:03:16 +00:00
<Parameters >
2005-01-24 18:25:02 +00:00
<Parameter Name= "mime_type" Type= "System.String" />
2004-11-05 19:03:16 +00:00
</Parameters>
<Docs >
<summary > To be added</summary>
2005-01-24 18:25:02 +00:00
<param name= "mime_type" > a <see cref= "T:System.String" /> </param>
2004-11-05 19:03:16 +00:00
<returns > a <see cref= "T:Gdk.PixbufLoader" /> </returns>
<remarks > To be added</remarks>
</Docs>
</Member>
2005-04-01 14:54:12 +00:00
<Member MemberName= "LoadFromResource" >
<MemberSignature Language= "C#" Value= "public static Gdk.PixbufLoader LoadFromResource (string resource);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > Gdk.PixbufLoader</ReturnType>
</ReturnValue>
<Parameters >
<Parameter Name= "resource" Type= "System.String" />
</Parameters>
<Docs >
<summary > Loads a pixbuf from a resource file.</summary>
<param name= "resource" > the name of the resource</param>
<returns > a <see cref= "T:Gdk.PixbufLoader" /> </returns>
<remarks >
This creates a pixbuf loader to load from a resource in the calling assembly.
This is equivalent to using the
<see cref= "C:Gdk.PixbufLoader(System.Reflection.Assembly, System.String)" />
constructor with a <see langword= "null" /> assembly.
</remarks>
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public PixbufLoader (System.IO.Stream stream);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
<Parameter Name= "stream" Type= "System.IO.Stream" />
</Parameters>
<Docs >
<summary > Loads a Pixbuf from a <see cref= "T:System.IO.Stream" /> .</summary>
<param name= "stream" > a <see cref= "T:System.IO.Stream" /> </param>
<returns > a <see cref= "T:Gdk.PixbufLoader" /> </returns>
<remarks > See also <see cref= "C:Gdk.Pixbuf(System.IO.Stream)" /> </remarks>
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public PixbufLoader (System.Reflection.Assembly assembly, string resource);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
<Parameter Name= "assembly" Type= "System.Reflection.Assembly" />
<Parameter Name= "resource" Type= "System.String" />
</Parameters>
<Docs >
<summary > Loads a Pixbuf embedded in an assembly</summary>
<param name= "assembly" > The <see cref= "T:System.Reflection.Assembly" /> that contains the image.
<para >
If the value is <see langword= "null" /> , the image will be looked up on the calling assembly.</para> </param>
<param name= "resource" > The name given as the resource in the assembly</param>
<returns > a <see cref= "T:Gdk.PixbufLoader" /> for the resource stream</returns>
<remarks > See also <see cref= "C:Gdk.Pixbuf(System.Reflection.Assembly,System.String)" /> </remarks>
</Docs>
</Member>
2003-02-12 01:57:20 +00:00
</Members>
2005-04-01 14:54:12 +00:00
</Type>