FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about Pixmap vs Pixbuf

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
zane.sims



Joined: 07 Aug 2007
Posts: 40

PostPosted: Thu Aug 27, 2009 7:13 pm    Post subject: Question about Pixmap vs Pixbuf Reply with quote

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 Smile ). 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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Fri Aug 28, 2009 1:51 pm    Post subject: Re: Question about Pixmap vs Pixbuf Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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