axapta - Best/Easier way to add a shape/image to a Dynamics AX 2009 form? -
i add few coloured square shapes form in order display legend. since haven't come across way of adding coloured-in shapes, i've resorted creating shapes images, loading them resources , trying load them form...although seems lengthy workaround simple single-coloured square.
first off, there way of adding basic shape of given colour ax form? otherwise, there easier way of adding image form without having replicate companyimage (or companyinfo) form?
note: i'm looking have image stored within ax proper , not having image linked filepath image on local machine.
you can draw simple shapes wingdi class
. here simple sample :
void drawshapes() { wingdi wingdi; int brush, height, width; ; //mywindow being formwindowcontrol height = mywindow.heightvalue()/2; width = mywindow.widthvalue()/2; mywindow.lockdc(); wingdi = new wingdi(mywindow.hdc()); brush = wingdi.createsolidbrush(winapi::rgb2int(0, 0, 255)); wingdi.fillrect(0, 0, width, height, brush); wingdi.deleteobject(brush); wingdi.ellipse(0, 0, width, height); brush = wingdi.createsolidbrush(winapi::rgb2int(255, 0, 0)); wingdi.fillrect(width, height, 2*width, 2*height, brush); wingdi.deleteobject(brush); mywindow.unlockdc(); }
i assume got similar.
now if call once in form's init
, drawing's erased paint
method of window control called (and it's called pretty often).
so easiest way call in paint
method of window. way every time mywindow's content redrawn, shapes too.
can force redrawing of shapes @ (short) regular time interval tetris tutorial (look @ cycle
method) using settimeout
may overkill static content.
you should have this