View previous topic :: View next topic |
Author |
Message |
zane.sims
Joined: 07 Aug 2007 Posts: 40
|
Posted: Thu Aug 27, 2009 7:13 pm Post subject: Question about Pixmap vs Pixbuf |
|
|
Hello,
I am fairly new to Gtk and very new to Gtkd. I have to say that everything seems to be set up real nice, but I am having trouble with understanding Pixmap vs Pixbuf. I realize that Pixmap is a Drawable and that I can create a Pixbuf from a Pixmap Drawable, but how can I get a Pixmap from a Pixbuf? Maybe I am making this too complicated (I do that a lot ). but if you take the classic doodle program for instance where you can read in a image file, draw on it, then save it back to a file, would it be done this way?:
1) Open with Pixbuf.this( filename );
2) Convert Pixbuf to Pixmap
3) Draw liberally on Pixmap with Pixmap.drawWhatever(...);
4) Convert Back to Pixbuf
5) Save with Pixbuf.savev(filename, ...);
Any guidance you could provide would be very appreciated.
Thanks,
Zane _________________ わたしがプログラマだよ! |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Fri Aug 28, 2009 1:51 pm Post subject: Re: Question about Pixmap vs Pixbuf |
|
|
zane.sims wrote: |
1) Open with Pixbuf.this( filename );
2) Convert Pixbuf to Pixmap |
gdk.Drawable.drawPixbuf(...);
Quote: | 3) Draw liberally on Pixmap with Pixmap.drawWhatever(...);
4) Convert Back to Pixbuf |
gdk.Pixbuf.getFromDrawable(...);
Quote: | 5) Save with Pixbuf.savev(filename, ...);
|
I don't have any experience with pixbufs and pixmaps, the functions above should do what you are asking for. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|