See the previous question. You should probably use the GDK RGB functions (the section called RGB Buffers in the chapter called GDK Basics).