Error in the function: DC_Scrn2ImageFile

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Error in the function: DC_Scrn2ImageFile

#1 Post 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()
Attachments
err1.jpg
err1.jpg (110.49 KiB) Viewed 8434 times

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error in the function: DC_Scrn2ImageFile

#2 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Error in the function: DC_Scrn2ImageFile

#3 Post 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)                       // Перейти в папку текущего приложения

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error in the function: DC_Scrn2ImageFile

#4 Post 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 )
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Error in the function: DC_Scrn2ImageFile

#5 Post by Eugene Lutsenko »

INSERT command. There is a message:
Attachments
err.jpg
err.jpg (167.83 KiB) Viewed 8400 times

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error in the function: DC_Scrn2ImageFile

#6 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Error in the function: DC_Scrn2ImageFile

#7 Post 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.

Post Reply