mail-archives/gtk-sharp-list/2004-April/003933.html

88 строки
3.1 KiB
HTML
Исходник Постоянная ссылка Обычный вид История

2019-06-06 22:02:55 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Problem with Pixbuf
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:scut%40nb.in-berlin.de">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="003930.html">
<LINK REL="Next" HREF="003935.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Problem with Pixbuf
</H1>
<B>Sebastian
</B>
<A HREF="mailto:scut%40nb.in-berlin.de"
TITLE="[Gtk-sharp-list] Problem with Pixbuf">scut@nb.in-berlin.de
</A><BR>
<I>Mon, 26 Apr 2004 09:34:31 +0800</I>
<P><UL>
<LI> Previous message: <A HREF="003930.html">[Gtk-sharp-list] Problem with Pixbuf
</A></li>
<LI> Next message: <A HREF="003935.html">[Gtk-sharp-list] bitmap question
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3933">[ date ]</a>
<a href="thread.html#3933">[ thread ]</a>
<a href="subject.html#3933">[ subject ]</a>
<a href="author.html#3933">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi Olafur,
On Sun, Apr 25, 2004 at 06:43:29PM +0100, Olafur Arason wrote:
&gt;<i> I'm trying to use the pixels functionality of Pixbuf and using p = pixels
</I>&gt;<i> + y * rowstride + x * n_channels to get the color, but in gtk-sharp the
</I>&gt;<i> values are copied not linked. So the problem is that I have is a copy of
</I>&gt;<i> pixles not the direct Pixbuf image, so to get the data into Pixbuf I have
</I>&gt;<i> to have a cvs version of Pixbuf and do a pixbuf = new Pixbuf(-1, pixels,1)
</I>&gt;<i> but this may be a stupit question but I'm new to c# how do you change
</I>&gt;<i> byte* to byte[].
</I>
I use something like this (pbuf being a Gdk.Pixbuf):
pbuf.Pixels[y * pbuf.Rowstride + x * pbuf.NChannels + 0] = 255;
pbuf.Pixels[y * pbuf.Rowstride + x * pbuf.NChannels + 1] = 0;
pbuf.Pixels[y * pbuf.Rowstride + x * pbuf.NChannels + 2] = 0;
to set the pixel at (x, y) to red for example.
I found that updating the pixbuf is no problem, just schedule a QueueDraw
for the Gtk.Image widget on top of it.
&gt;<i> Olafur Arason
</I>
ciao,
Sebastian
--
|\ _,,,--,,_ ,) <A HREF="mailto:scut@nb.in-berlin.de">scut@nb.in-berlin.de</A>, <A HREF="http://segfault.net/~scut/pgp">http://segfault.net/~scut/pgp</A>
/,`.-'`' -, ;-;;' 5453 AC95 1E02 FDA7 50D2 A42D 427E 6DEF 745A 8E07
_ |,4- ) )-,_ ) /\__________________________________________________________
~'---''(_/--' (_/-'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="003930.html">[Gtk-sharp-list] Problem with Pixbuf
</A></li>
<LI> Next message: <A HREF="003935.html">[Gtk-sharp-list] bitmap question
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3933">[ date ]</a>
<a href="thread.html#3933">[ thread ]</a>
<a href="subject.html#3933">[ subject ]</a>
<a href="author.html#3933">[ author ]</a>
</LI>
</UL>
</body></html>