DLangUI: Rendering a generated image
Alex Parrill via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 14 17:25:53 PDT 2015
I found the `ImageWidget` class in controls.d, but I'm still
having the same issue.
Tweaked code (replaced the section between `window.mainWidget =
baseLayout;` and `baseLayout.addChild((new Button())...`
auto img = Ref!DrawBuf(new ColorDrawBuf(W,H));
draw(cast(ColorDrawBuf) (img.get));
auto drawableImg = Ref!ImageDrawable(new ImageDrawable(img));
auto canvas = new ImageWidget();
canvas.drawable = drawableImg;
baseLayout.addChild(canvas);
More information about the Digitalmars-d-learn
mailing list