Re: GTKD - Write Pixbuf back to context

2016-01-08 Thread TheDGuy via Digitalmars-d-learn

On Thursday, 7 January 2016 at 21:35:40 UTC, Gerald wrote:

https://developer.gnome.org/gtkmm-tutorial/stable/sec-draw-images.html.en

Does this work for you?


Yes, thank you very much!

cr.paint();


GTKD - Write Pixbuf back to context

2016-01-07 Thread TheDGuy via Digitalmars-d-learn

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);



Re: GTKD - Write Pixbuf back to context

2016-01-07 Thread Gerald via Digitalmars-d-learn

https://developer.gnome.org/gtkmm-tutorial/stable/sec-draw-images.html.en

Does this work for you?