LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-05-2008, 12:05 PM   #1
sumitshining
Member
 
Registered: Oct 2008
Distribution: Fedora, Ubuntu
Posts: 30

Rep: Reputation: 15
how to convert pixbuf to pixdata??


i'm workin on image comp....i need image be converted to data stream.i tried it this way:

GdkPixbuf *pixbuf;
GdkPixdata *pixdata;
guchar *sumit;

..
..
..

gdk_pixdata_from_pixbuf(pixdata,pixdata,FALSE);
gdk_pixdata_to_csource(pixdata,sumit,0);

..
..


no error while compiling..but when it executes..
it gives an error:
GdkPixbuf_CRITICAL ...assertion pixdata!=NULL failed...



can any1 help me to sort this out...
 
Old 11-06-2008, 09:22 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
This looks like a vanilla C bug. You've said 'pixdata is a pointer to a GdkPixdata', but there has been no allocation of said GdkPixdata. Either GTK has a method to allocate such a buffer, or you can allocate one using malloc(), calloc(), etc.
--- rod.
 
Old 11-07-2008, 07:06 AM   #3
sumitshining
Member
 
Registered: Oct 2008
Distribution: Fedora, Ubuntu
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by theNbomr View Post
This looks like a vanilla C bug. You've said 'pixdata is a pointer to a GdkPixdata', but there has been no allocation of said GdkPixdata. Either GTK has a method to allocate such a buffer, or you can allocate one using malloc(), calloc(), etc.
--- rod.
thnx bro!!!.....but i did it bfore u replied...but not d way u hav reffered to........rather i assigned the address of pixbuf to pixdata...n it worked...........
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use gdk-pixbuf-csource?? sumitshining Programming 4 11-05-2008 08:18 AM
xChat configure can't find pixbuf. Ghetto_Penguin Linux - Software 1 01-03-2005 03:14 PM
Slowdown after applying pixbuf update cyclocommuter Mandriva 0 09-22-2004 07:29 AM
what package contains gdk-pixbuf-2.0 behmjose Linux - General 1 04-03-2004 06:20 PM
gdk-pixbuf update windsok Slackware 4 09-09-2003 02:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration