2007-01-09 Mike Kestner <mkestner@novell.com>

* sample/GtkDemo/DemoPixbuf.cs : use Marshal.Copy properly
	to avoid expose crashes. Revised from patch provided by
	Fabian Sturm.  [#78262]

svn path=/trunk/gtk-sharp/; revision=70738
This commit is contained in:
Mike Kestner 2007-01-09 20:59:40 +00:00
parent f4ae7e3e8c
commit 296a0b73d0
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2007-01-09 Mike Kestner <mkestner@novell.com>
* sample/GtkDemo/DemoPixbuf.cs : use Marshal.Copy properly
to avoid expose crashes. Revised from patch provided by
Fabian Sturm. [#78262]
2007-01-09 Mike Kestner <mkestner@novell.com>
* sample/GtkDemo/DemoIconView.cs : use Gtk.Stock icons to avoid

View file

@ -80,7 +80,8 @@ namespace GtkDemo
rowstride = frame.Rowstride;
pixels = new byte[(frame.Height - area.Y) * rowstride];
Marshal.Copy (frame.Pixels, pixels, rowstride * area.Y + area.X * 3, pixels.Length);
IntPtr src = (IntPtr)(frame.Pixels.ToInt64 () + rowstride * area.Y + area.X * 3);
Marshal.Copy (src, pixels, 0, pixels.Length);
widget.GdkWindow.DrawRgbImageDithalign (widget.Style.BlackGC,
area.X, area.Y, area.Width, area.Height,