Page 1 of 1
Error in the function: DC_Scrn2ImageFile
Posted: Sun Apr 10, 2016 11:05 pm
by Eugene Lutsenko
Perhaps I somehow not appeal to her. But what exactly should be done to use this feature? Previously, it worked fine, but I used XbpPresSpace()
Re: Error in the function: DC_Scrn2ImageFile
Posted: Mon Apr 11, 2016 5:24 am
by rdonnay
You must pass an Xbase++ parts object as the first parameter.
This is usually the dialog object or the drawingarea of the dialog object.
Example:
Code: Select all
@ 10,10 DCSAY 'Hello World'
DCREAD GUI EVAL {|o| DC_Scrn2ImageFile(o:drawingArea,'MyScreen.Jpg',XBPBMP_FORMAT_JPG)}
It appears that I never documented DC_Scrn2ImageFile().
I will correct this in build 264.
Re: Error in the function: DC_Scrn2ImageFile
Posted: Mon Apr 11, 2016 7:10 am
by Eugene Lutsenko
Hey, Roger!
In this embodiment, the function creates a new empty window, which successfully writes to a file.
And if the window is already open, and it has created the image, how to write it?
The strange thing is that I can say stumbled on Pustomiti place, ie where I did not expect. The fact that this function I used successfully many times before without any problems. What a great thank you. Function call was about:
Code: Select all
DIRCHANGE(M_PathAppl+"\ParetoGrOpSc\") // Перейти в папку ParetoGrOpSc
cFileName = "ParetoGrOpSc-"+UPPER(Ar_Model[mNumMod])+".bmp"
ERASE(cFileName)
DC_Scrn2ImageFile( oStatic, cFileName )
DIRCHANGE(M_PathAppl) // Перейти в папку текущего приложения
Re: Error in the function: DC_Scrn2ImageFile
Posted: Mon Apr 11, 2016 8:01 am
by rdonnay
You are getting an error because oStatic is not an object.
I suggest adding a debug command to see if I am correct about this.
Code: Select all
DIRCHANGE(M_PathAppl+"\ParetoGrOpSc\") // Перейти в папку ParetoGrOpSc
cFileName = "ParetoGrOpSc-"+UPPER(Ar_Model[mNumMod])+".bmp"
ERASE(cFileName)
WTF oStatic PAUSE <<<<<<<<<<<<<<<<<<<<<<<<
DC_Scrn2ImageFile( oStatic, cFileName )
Re: Error in the function: DC_Scrn2ImageFile
Posted: Mon Apr 11, 2016 9:33 am
by Eugene Lutsenko
INSERT command. There is a message:
Re: Error in the function: DC_Scrn2ImageFile
Posted: Mon Apr 11, 2016 11:12 am
by rdonnay
I am correct. oStatic is a logical .F., not an object.
You need to look at what you are passing to the function.
Re: Error in the function: DC_Scrn2ImageFile
Posted: Mon Apr 11, 2016 11:19 am
by Eugene Lutsenko
I looked at as a graphical object is created in your example:
DREAD GUI FIT TITLE '4.8. Geokognitivnaya subsystem "Eidos" 'OPTIONS GetOptions; EVAL {|| GraTest (oStatic1)} SETAPPWINDOW
It uses a variable: oStatic1. I used it in DC_Scrn2ImageFile (oStatic1, cFileName) and it worked! Many thanks for the tip where and what to look for.