Hello,

after i found out how i can access the pixel data in this thread:

http://forum.dlang.org/thread/ljktabqxzdjprrqca...@forum.dlang.org

i want to know how i can write the Pixbuf back to my context?

This code doesn't work because the color does not change:

cr.setSourceRgb(0,0,0);
cr.rectangle(0,0,125,125);
cr.fill();

GtkAllocation size;
Pixbuf surface;
getAllocation(size);
this.width = size.width;
this.height = size.height;

surface = getFromSurface(cr.getTarget(),0,0,size.width,size.height);
auto pixelArray = surface.getPixels();
for (int i = 0; i < (this.width*this.height*3);i++){
        pixelArray[i] = 125;
}

setSourcePixbuf(cr,surface,0,0);

Reply via email to