[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: Draw multiple Gdk::Pixbuf to one DrawingArea?
From:       Harry Van Haaren <harryhaaren () gmail ! com>
Date:       2010-12-21 20:14:31
Message-ID: AANLkTimnCG1CLieibhCHgdbQBcE6dYUMZP0s8JuABX5p () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hey Krzesimir,

Thanks for the reply... I don't think I changed any of the code.. but its
working now :-)
Real noob mistake or something going on.. *blushes*, time for a break I
think!

Cheers, -Harry

On Tue, Dec 21, 2010 at 5:42 PM, Krzesimir Nowak <qdlacz@gmail.com> wrote:

> On Tue, 2010-12-21 at 14:45 +0000, Harry Van Haaren wrote:
> > Hey all,
> >
> > I've been trying to get this sorted for a while, and now I'm resorting to
> > asking yee guys. :-)
> >
> > I have a class that derives from a DrawingArea, and in this widget I want
> to
> > display 2 .png files.
> >
> > I have code to show 1 image:
> > Glib::RefPtr<Gdk::Pixbuf> faderImage=
> > Gdk::Pixbuf::create_from_file("faderGreen.png");
> >
> > faderImage  -> render_to_drawable(    get_window() ,
> >                                         get_style()->get_black_gc(),
> >                                         0, 0, 42, 100,
> >                                         faderImage->get_width(),
> > faderImage->get_height(),
> >                                         Gdk::RGB_DITHER_NONE, 0, 0);
> >
> > That code works perfect, just as I'd want it to. The problems start here:
> >
> > I create another Pixbuf pointer:
> > Glib::RefPtr<Gdk::Pixbuf> backgroundImage;
> >
> > And compiling will still work, but the program segfaults? Is there
> something
> > that you can't have
> > 2 Glib::RefPtr 's in one class or something?
> >
> > Hope somebody can help, cheers, -Harry
>
> Since I don't see much code then I can guess that maybe one of your
> Glib::RefPtrs is NULL.
>
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>
>

[Attachment #5 (text/html)]

Hey Krzesimir,<br><br>Thanks for the reply... I don&#39;t think I changed any of the \
code.. but its working now :-)<br>Real noob mistake or something going on.. \
*blushes*, time for a break I think!<br><br>Cheers, -Harry<br> <br><div \
class="gmail_quote">On Tue, Dec 21, 2010 at 5:42 PM, Krzesimir Nowak <span \
dir="ltr">&lt;<a href="mailto:qdlacz@gmail.com">qdlacz@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div><div></div><div \
class="h5">On Tue, 2010-12-21 at 14:45 +0000, Harry Van Haaren wrote:<br> &gt; Hey \
all,<br> &gt;<br>
&gt; I&#39;ve been trying to get this sorted for a while, and now I&#39;m resorting \
to<br> &gt; asking yee guys. :-)<br>
&gt;<br>
&gt; I have a class that derives from a DrawingArea, and in this widget I want to<br>
&gt; display 2 .png files.<br>
&gt;<br>
&gt; I have code to show 1 image:<br>
&gt; Glib::RefPtr&lt;Gdk::Pixbuf&gt; faderImage=<br>
&gt; Gdk::Pixbuf::create_from_file(&quot;faderGreen.png&quot;);<br>
&gt;<br>
&gt; faderImage  -&gt; render_to_drawable(    get_window() ,<br>
&gt;                                         get_style()-&gt;get_black_gc(),<br>
&gt;                                         0, 0, 42, 100,<br>
&gt;                                         faderImage-&gt;get_width(),<br>
&gt; faderImage-&gt;get_height(),<br>
&gt;                                         Gdk::RGB_DITHER_NONE, 0, 0);<br>
&gt;<br>
&gt; That code works perfect, just as I&#39;d want it to. The problems start \
here:<br> &gt;<br>
&gt; I create another Pixbuf pointer:<br>
&gt; Glib::RefPtr&lt;Gdk::Pixbuf&gt; backgroundImage;<br>
&gt;<br>
&gt; And compiling will still work, but the program segfaults? Is there something<br>
&gt; that you can&#39;t have<br>
&gt; 2 Glib::RefPtr &#39;s in one class or something?<br>
&gt;<br>
&gt; Hope somebody can help, cheers, -Harry<br>
<br>
</div></div>Since I don&#39;t see much code then I can guess that maybe one of \
your<br> Glib::RefPtrs is NULL.<br>
<br>
&gt; _______________________________________________<br>
&gt; gtkmm-list mailing list<br>
&gt; <a href="mailto:gtkmm-list@gnome.org">gtkmm-list@gnome.org</a><br>
&gt; <a href="http://mail.gnome.org/mailman/listinfo/gtkmm-list" \
target="_blank">http://mail.gnome.org/mailman/listinfo/gtkmm-list</a><br> <br>
<br>
</blockquote></div><br>



_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic