Ph1.14A: snapshot broken :-((

The latest Photon Patch 1.14A contains a snapshot, that doesn’t
accept it’s arguments anymore:

If started without any arguments at all, it works, but if it is
started like the example in the online docs

snapshot -A 100100 -o 5050 -p “BMP Spool File” -f /tmp/bla.bmp

it fails with the error message

Error 0 while attempting to open printer definition.
Nothing done

However, what we need really urgent now is a possibility to create a
PHS file
of the currently visible screen.


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Hi,

we descovered another snapshot arguments problem:
in June 2000 cd version, snapshot dated Sep 14 1999, requires the -p
argument.
Before we called snapshot without, and it took the default printer (I
think).
Now without giving the -p, the same error as Karsten saw occurs.

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Karsten Hoffmann wrote:

The latest Photon Patch 1.14A contains a snapshot, that doesn’t
accept it’s arguments anymore:

If started without any arguments at all, it works, but if it is
started like the example in the online docs

snapshot -A 100100 -o 5050 -p “BMP Spool File” -f /tmp/bla.bmp

it fails with the error message

Error 0 while attempting to open printer definition.
Nothing done

However, what we need really urgent now is a possibility to create a
PHS file
of the currently visible screen.


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

I had problems with snapshot too. When I used -A and -o option to print a
portion of entire screen, the screen did not refresh properly. But if I
print entire screen, it works fine. I have posted the problems to QDN,
hopefully someone in QNX will look at it.

-Jim Nie
Kingwa Technologies, Inc.
Irvine, CA
jim_nie@msn.com

“Friedhelm Schuetz” <Friedhelm.Schuetz@kleinknecht.de> wrote in message
news:3A826A2F.81795474@kleinknecht.de

Hi,

we descovered another snapshot arguments problem:
in June 2000 cd version, snapshot dated Sep 14 1999, requires the -p
argument.
Before we called snapshot without, and it took the default printer (I
think).
Now without giving the -p, the same error as Karsten saw occurs.

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Karsten Hoffmann wrote:

The latest Photon Patch 1.14A contains a snapshot, that doesn’t
accept it’s arguments anymore:

If started without any arguments at all, it works, but if it is
started like the example in the online docs

snapshot -A 100100 -o 5050 -p “BMP Spool File” -f /tmp/bla.bmp

it fails with the error message

Error 0 while attempting to open printer definition.
Nothing done

However, what we need really urgent now is a possibility to create a
PHS file
of the currently visible screen.


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

I don’t know exactly what you need to do, but when we want to paste
screenshots of our Photon programs into manuals etc., we just use a windows
capture utility in Phindows i.e. capture a portion of the Windows window
:wink:

Works great.

PaintShopPro has screen capture, the default key is CTRL+C

Regards, Tristan.


Tristan Crees B.C.S.E
Robotics Engineer
International Submarine Engineering (http://www.ise.bc.ca)
1734 Broadway St. Port Coquitlam BC Canada V3C 2M8

“jim_nie” <jim_nie@email.msn.com> wrote in message
news:95uh90$g30$1@inn.qnx.com

I had problems with snapshot too. When I used -A and -o option to print a
portion of entire screen, the screen did not refresh properly. But if I
print entire screen, it works fine. I have posted the problems to QDN,
hopefully someone in QNX will look at it.

-Jim Nie
Kingwa Technologies, Inc.
Irvine, CA
jim_nie@msn.com

“Friedhelm Schuetz” <> Friedhelm.Schuetz@kleinknecht.de> > wrote in message
news:> 3A826A2F.81795474@kleinknecht.de> …
Hi,

we descovered another snapshot arguments problem:
in June 2000 cd version, snapshot dated Sep 14 1999, requires the -p
argument.
Before we called snapshot without, and it took the default printer (I
think).
Now without giving the -p, the same error as Karsten saw occurs.

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Karsten Hoffmann wrote:

The latest Photon Patch 1.14A contains a snapshot, that doesn’t
accept it’s arguments anymore:

If started without any arguments at all, it works, but if it is
started like the example in the online docs

snapshot -A 100100 -o 5050 -p “BMP Spool File” -f /tmp/bla.bmp

it fails with the error message

Error 0 while attempting to open printer definition.
Nothing done

However, what we need really urgent now is a possibility to create a
PHS file
of the currently visible screen.


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Tristan Crees wrote:

I don’t know exactly what you need to do, but when we want to paste
screenshots of our Photon programs into manuals etc., we just use a windows
capture utility in Phindows i.e. capture a portion of the Windows window
:wink:

No option for us, we (better say: out customers) need screenshots within
a pure QNX/Photon environment. And since we embedded the ‘snapshot’
utility
for creating the PHS-Files into our programmes, we need the arguments,
that
‘snapshot’ used to have.

Is anybody of QSSL reading this?


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Hi,

  1. If you dont give the -p option then snapshot will use
    the default printer.
  2. The example in the use message doesn’t work because
    snapshot will not accept quotes in the printer name.
  3. As a consequence of (2) printer names cannot have spaces
    in them.

The easy work around is to make BMP Spool File your default printer
but unfortunately the distribution Pp.bmp doesn’y work well with
snapshot there is a newer version of Pp.bmp that should make it
out in the next patch for Photon 1.14 (patch B).

I talked to the developer and he said that Karsten has been sent
the a print filter that has been updated with this fix. Perhaps
he could share this? I am not allowed to send out anything
unfortunatly.



Friedhelm Schuetz <Friedhelm.Schuetz@kleinknecht.de> wrote:

Hi,

we descovered another snapshot arguments problem:
in June 2000 cd version, snapshot dated Sep 14 1999, requires the -p
argument.
Before we called snapshot without, and it took the default printer (I
think).
Now without giving the -p, the same error as Karsten saw occurs.

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Karsten Hoffmann wrote:

The latest Photon Patch 1.14A contains a snapshot, that doesn’t
accept it’s arguments anymore:

If started without any arguments at all, it works, but if it is
started like the example in the online docs

snapshot -A 100100 -o 5050 -p “BMP Spool File” -f /tmp/bla.bmp

it fails with the error message

Error 0 while attempting to open printer definition.
Nothing done

However, what we need really urgent now is a possibility to create a
PHS file
of the currently visible screen.


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Hardware Support Account wrote:

  1. If you dont give the -p option then snapshot will use
    the default printer.
  2. The example in the use message doesn’t work because
    snapshot will not accept quotes in the printer name.

I also tried PHS_FILE as printer name: nothing changed.

  1. As a consequence of (2) printer names cannot have spaces
    in them.

The easy work around is to make BMP Spool File your default printer
but unfortunately the distribution Pp.bmp doesn’y work well with
snapshot there is a newer version of Pp.bmp that should make it
out in the next patch for Photon 1.14 (patch B).

Well, not the Pp.bmp is our actual problem, but the generation of
a PHS file, initiated from a frontend programme. We cannot use
the printer dialog for some reasons (customer related), so we simply
need something like

snapshot -o1010 -A100100 -f/tmp/output.phs -pPHS_FILE


If I summarize the behaviour of the current snapshot with a very reduced
‘printers’-file (see below)

snapshot (without parameters) : opens printer dialog

snapshot -A100*100 : opens printer dialog

snapshot -A100100 -o1010 : issues error message
Error 0 while attempting to open printer definition.
Nothing done

The usage of the ‘-p’ and ‘-f’ options doesn’t change the behaviour.
Neither does the usage of quotes or double quotes around the options.

BTW: is the useage of the ‘-A’ and ‘-o’ meant to be written with ‘x’ or
‘*’;
Programme usage and online doc differ in this point.

And here’s my printer definition file (printer was set up as default
printer)

/usr/photon/print/printers:

[PHS_FILE]
Location = PHS File
Supported PaperSize = 8267x11692:A4
PaperSize = 8267x11692

\


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

ping on this thread

Any results, thinking, ideas, working about this problem?

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH


Karsten Hoffmann wrote:

Hardware Support Account wrote:

  1. If you dont give the -p option then snapshot will use
    the default printer.
  2. The example in the use message doesn’t work because
    snapshot will not accept quotes in the printer name.

I also tried PHS_FILE as printer name: nothing changed.

  1. As a consequence of (2) printer names cannot have spaces
    in them.

The easy work around is to make BMP Spool File your default printer
but unfortunately the distribution Pp.bmp doesn’y work well with
snapshot there is a newer version of Pp.bmp that should make it
out in the next patch for Photon 1.14 (patch B).

Well, not the Pp.bmp is our actual problem, but the generation of
a PHS file, initiated from a frontend programme. We cannot use
the printer dialog for some reasons (customer related), so we simply
need something like

snapshot -o1010 -A100100 -f/tmp/output.phs -pPHS_FILE

If I summarize the behaviour of the current snapshot with a very reduced
‘printers’-file (see below)

snapshot (without parameters) : opens printer dialog

snapshot -A100*100 : opens printer dialog

snapshot -A100100 -o1010 : issues error message
Error 0 while attempting to open printer definition.
Nothing done

The usage of the ‘-p’ and ‘-f’ options doesn’t change the behaviour.
Neither does the usage of quotes or double quotes around the options.

BTW: is the useage of the ‘-A’ and ‘-o’ meant to be written with ‘x’ or
‘*’;
Programme usage and online doc differ in this point.

And here’s my printer definition file (printer was set up as default
printer)

/usr/photon/print/printers:

[PHS_FILE]
Location = PHS File
Supported PaperSize = 8267x11692:A4
PaperSize = 8267x11692


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Friedhelm Schuetz wrote:

ping on this thread

Any results, thinking, ideas, working about this problem?

Regarding the snapshot utility: no!

But from QSSL-Germany I got some hints, how to do it in
C (a good chance to get rid of that dependency :slight_smile: )


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Hi,

are you able to share those hints?
Maybe QSSL Germany can feed the knowledge base?

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Karsten Hoffmann wrote:

Regarding the snapshot utility: no!

But from QSSL-Germany I got some hints, how to do it in
C (a good chance to get rid of that dependency > :slight_smile: > )

Friedhelm Schuetz wrote:

are you able to share those hints?
Maybe QSSL Germany can feed the knowledge base?

Sure, though I hadn’t been very successful yet!

Here’s my actual approach:



PhRid_t open_region( PhRect_t* extent )
{
PhRegion_t region;
PhRect_t rect;
PhRid_t rid;

memset(&region, 0, sizeof(region));
/*
** This is a printer-like region
*/
region.flags = Ph_PRINT_REGION | Ph_FORCE_FRONT;

/* Wish to have draw events

  • events enqueued to us.
    */
    region.events_sense = Ph_EV_DRAW;

/*
*
*/
region.events_opaque = 0;

/* Origin taken from extent */
region.origin.x = extent->ul.x;
region.origin.y = extent->ul.y;
region.parent = Ph_DEV_RID;

/* Region taken from extent */
rect.ul.x = extent->ul.x;
rect.ul.y = extent->ul.y;
rect.lr.x = extent->lr.x;
rect.lr.y = extent->lr.y;

rid = PhRegionOpen( Ph_REGION_PARENT |
Ph_REGION_FLAGS |
Ph_REGION_EV_SENSE |
Ph_REGION_EV_OPAQUE |
Ph_REGION_ORIGIN |
Ph_REGION_RECT,
&region, &rect, NULL );

return( rid );
}




int StartSnapshot( char filename )
{
PhRect_t tExtent;
PhRect_t event_rect;
PpPrintContext_t
pc;
short orientation = 1; // For landscape
int err;
PhEvent_t event;
PhRid_t rid;


if ( PhWindowQueryVisible( 0, 0, 1, &tExtent ) != 0 )
{
printf(“Cannot query visible extent: %s\n”,strerror(errno));
return -1;
}


/*
** Create a Region covering the visible Area and beeing sensitive
** to draw events …
/
rid = open_region(&tExtent);
PgSetRegion(rid);


/

** Create a print context
*/
pc = PpPrintCreatePC();
if(NULL == pc)
{
// check errno
printf(“Cannot create printer context: %s!\n”,strerror(errno));
return -3;
}
PpPrintSetPC( pc, INITIAL_PC, 0, Pp_PC_NAME, “PHS_FILE” );
PpPrintSetPC( pc, INITIAL_PC, 0, Pp_PC_ORIENTATION, &orientation );
PpPrintSetPC( pc, INITIAL_PC, 0, Pp_PC_DEVICE, filename );
err = PpPrintOpen( pc );
if (err == -1)
{
// check errno
printf(“Cannot open printer context: %s!\n”,strerror(errno));
return -4;
}
// succeeded



PpPrintStart(pc);

// Start redrawing everything
memset(&event,0,sizeof(event));
event.type = Ph_EV_EXPOSE;
event.subtype = Ph_PRINTER_EXPOSE;
event.emitter.rid = Ph_DEV_RID;
event.flags = 0;
event.num_rects = 1;
event.data_len = 0;
event_rect.ul.x = event_rect.ul.y = SHRT_MIN;
event_rect.lr.x = event_rect.lr.y = SHRT_MAX;
if(0 != PhEventEmit(&event,&event_rect,NULL))
{
printf(“Cannot emit capture expose event: %s\n”,strerror(errno));
}

// Just a few tests …
{
int i;
PhRect_t rect = {100,100,50,20};
PgSetStrokeColor( Pg_GREEN );
PgSetFillColor( Pg_RED );
PgDrawRect( &rect, Pg_DRAW_FILL_STROKE );
PgFlush();
for(i=0; i<1000; i++)
PtBkgdHandlerProcess();
}


// Close the pc.
PpPrintStop(pc);
PpPrintClose(pc);
PpPrintReleasePC(pc);

PhRegionClose(rid);
return 0;
}


When I call this in my application, I get a PHS file containing
the coloured rectangle from the testing section and a gray square
in the upper left corner.

I’m not sure, how to emit the expose event correctly (there are
differences
between the docs and the Photon header files). Also I wonder, how to
wait for
the completion of the re-drawing process – I tried to call
PtBkgdHandlerProcess() some times, witch revealed the gray square, that
I
mentioned above.

Any ideas, what’s wrong with this piece of code?

(Source files of ‘snapshot’ would be best, of course! :wink:) )

TIA,

Karsten.


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Karsten Hoffmann <Karsten.Hoffmann@mbs-software.de> writes:

Sure, though I hadn’t been very successful yet!

Here’s my actual approach:



PhRid_t open_region( PhRect_t* extent )
{
PhRegion_t region;
PhRect_t rect;
PhRid_t rid;

Any success yet? I’m facing same problem…


M. Tavasti / tavastixx@iki.fi / +358-40-5078254
Poista sähköpostiosoitteesta molemmat x-kirjaimet
Remove x-letters from my e-mail address

“M. Tavasti” wrote:

Any success yet? I’m facing same problem…

No, nothing, even using our ‘Premium Support Plan’ didn’t reveal
anything, yet! :frowning:(

\


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Karsten Hoffmann <Karsten.Hoffmann@mbs-software.de> writes:

No, nothing, even using our ‘Premium Support Plan’ didn’t reveal
anything, yet! > :frowning:> (

Blaah! Is anybody reading these on QSSL? Do we get Snapshot sources?

Or do I have to mark this in my Linux vs QNX list :-/


M. Tavasti / tavastixx@iki.fi / +358-40-5078254
Poista sähköpostiosoitteesta molemmat x-kirjaimet
Remove x-letters from my e-mail address

Hello Everyone

Yes your comments are being heard. I am in the process of submitting
bug reports on the issues that you have brought up here. If you want the source then you can contact your sales rep about obtaining an NDA
for the code. If you are just dealing with a widget that you have created (not the whole screen), then you could also look in to using
the Pp* functions in photon to create your own printing capabilities. The only other suggestion that I have is that you move to Photon 2.0 on Neutrino.

Thanks
Rodney

Previously, M. Tavasti wrote in qdn.public.qnx4.photon:

Karsten Hoffmann <> Karsten.Hoffmann@mbs-software.de> > writes:

No, nothing, even using our ‘Premium Support Plan’ didn’t reveal
anything, yet! > :frowning:> (

Blaah! Is anybody reading these on QSSL? Do we get Snapshot sources?

Or do I have to mark this in my Linux vs QNX list :-/


M. Tavasti / > tavastixx@iki.fi > / +358-40-5078254
Poista sähköpostiosoitteesta molemmat x-kirjaimet
Remove x-letters from my e-mail address

gui@qnx.com” wrote:

Yes your comments are being heard.

Nice to hear somebody is at home :slight_smile:)

I am in the process of submitting
bug reports on the issues that you have brought up here. If you want the source then you can contact your sales rep about obtaining an NDA
for the code.

That’s what I tried, but QSSL Germany rejected.

They just sent me some snippets with the most important parts missing.
But since the docs are obviously quite out-of-date we’re stuck :frowning:(

If you are just dealing with a widget that you have created (not the whole screen), then you could also look in to using
the Pp* functions in photon to create your own printing capabilities.

In fact we only need a complete screenshot into a PHS file, without any
dialogs. It should work with
phditto/phindows sessions also.


Changing to Neutrino/Photon is no option, currently.


P.S.: I really can not understand what’s wrong with fixing snapshot
quite quickly, since it works in general? Simply skipping the Dialog
cannot be that hard …

\


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

gui@qnx.com” <gui@qnx.com> writes:

Yes your comments are being heard.

Nice to know.

for the code. If you are just dealing with a widget that you have created =
(not the whole screen), then you could also look in to using=20
the Pp* functions in photon to create your own printing capabilities.

Doesn’t look like option for me. All widget’s are self-made, but there
are partly overlapping windows, and we need screenshots for user
manuals. And we have many windows. Sound’s like too much work.

The = only other suggestion that I have is that you move to Photon
2.0 on Neutrin= o.

It’s not an option in this point.


M. Tavasti / tavastixx@iki.fi / +358-40-5078254
Poista sähköpostiosoitteesta molemmat x-kirjaimet
Remove x-letters from my e-mail address