www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Mirroring a drawable buf in DLangUI?

reply Dukc <ajieskola gmail.com> writes:
I am using the DrawRescaled method of DrawBuf[1] of DLangUI To 
draw a PNG image to a CanvasWidget[2] subclass. It has a minor 
issue of the box bounds showing in area that shoud be transparent 
but otherwise works well.

My question is, does anybody know a way to draw that image 
backwards without making another PNG file to do so? I tried to 
pass a dstrect with negative width but that results in nothing 
being drawn.

1: 
http://buggins.github.io/dlangui/ddox/dlangui/graphics/drawbuf/DrawBuf.html
2: 
http://buggins.github.io/dlangui/ddox/dlangui/widgets/controls/CanvasWidget.html
Nov 21 2017
next sibling parent reply Vadim Lopatin <coolreader.org gmail.com> writes:
On Tuesday, 21 November 2017 at 13:45:31 UTC, Dukc wrote:
 I am using the DrawRescaled method of DrawBuf[1] of DLangUI To 
 draw a PNG image to a CanvasWidget[2] subclass. It has a minor 
 issue of the box bounds showing in area that shoud be 
 transparent but otherwise works well.

 My question is, does anybody know a way to draw that image 
 backwards without making another PNG file to do so? I tried to 
 pass a dstrect with negative width but that results in nothing 
 being drawn.

 1: 
 http://buggins.github.io/dlangui/ddox/dlangui/graphics/drawbuf/DrawBuf.html
 2: 
 http://buggins.github.io/dlangui/ddox/dlangui/widgets/controls/CanvasWidget.html
There is no such feature currently, but it can be added easy.
Nov 23 2017
parent Dukc <ajieskola gmail.com> writes:
On Thursday, 23 November 2017 at 13:31:23 UTC, Vadim Lopatin 
wrote:
 There is no such feature currently, but it can be added easy.
In the meantime I should call OpenGL (I think it's the backend in my case) directly, correct?
Nov 23 2017
prev sibling parent Dukc <ajieskola gmail.com> writes:
On Tuesday, 21 November 2017 at 13:45:31 UTC, Dukc wrote:
 My question is, does anybody know a way to draw that image 
 backwards without making another PNG file to do so?
After a lot of code research, I believe the best way for me is to use DlangUI helpers in same way as in the new api of the opengl example[1], instead of using canvas and abstract drawable buffers. If I use orthogonal drawing instead of perspective, it should work for 2d icons as well as 3d. I still have to figure out how to use multiple textures in the same program through. 1: https://github.com/buggins/dlangui/tree/master/examples/opengl
Dec 04 2017