question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions regarding this lib

See original GitHub issue

Hello!

When I was checking out examples in this repo I came up with an idea of making software similar to LightShot but for Linux.

In this example we can see how to render current “screen dump” to other window. If I am not mistaken the first argument passed to X.getImage is supposed to be format which happens to be set to 2 in given example. I didn’t really know what it meant so I searched this repo and found this line. Unfortunately if I set format to 0 (bitmap according to previous link) in X.getImage I get this error:

{ Error: Bad param value
    at ReadFixedRequest.callback (/home/elderapo/nodejs/node-x11/lib/xcore.js:465:29)
    at ReadFixedRequest.execute (/home/elderapo/nodejs/node-x11/lib/unpackstream.js:41:10)
    at UnpackStream.resume (/home/elderapo/nodejs/node-x11/lib/unpackstream.js:165:30)
    at UnpackStream.write (/home/elderapo/nodejs/node-x11/lib/unpackstream.js:102:10)
    at Socket.<anonymous> (/home/elderapo/nodejs/node-x11/lib/xcore.js:88:21)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:266:12)
    at readableAddChunk (_stream_readable.js:253:11)
    at Socket.Readable.push (_stream_readable.js:211:10)
  error: 2,
  seq: 7,
  message: 'Bad param value',
  badParam: 0,
  minorOpcode: 0,
  majorOpcode: 73 }

I guess this error means that 0 (bitmap) is incorrect value and that if I want to get bitmap I should convert ZPixmap to bitmap. If so any tips how I can achive that?

Also I was wondering if it’s possible to get color of the pixel at given coordinates in x window. I found some c++ snippets using XGetImage and XGetPixel to achieve that but I couldn’t find anything about GetPixel in this repo.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sidorarescommented, Oct 4, 2017

Can’t remember what’s the status of mit-shm extension here. I did some research a while ago but as far as I can remember not finished implementation. Would be good to add it

https://www.npmjs.com/package/nodeshm https://www.x.org/releases/X11R7.7/doc/xextproto/shm.txt

0reactions
sidorarescommented, Oct 4, 2017

You can try to use MIT-SHM extension. The idea is that if server and client share same memory you can avoid copying large amount of data over network ( 1920x1080x32bit = 6 MBytes, 70 ms not that bad actually for this amount )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Questions for students about the library
For this study, what would you like to be called? Q1. How long have you been a student here? Q2. Have you been...
Read more >
Frequently Asked Questions | About the Library
Questions. What is the Library of Congress? Where are the books? Does the Library have a copy of every book published in the...
Read more >
10 questions about books, libraries, librarians, and schools
10 questions about books, libraries, librarians, and schools - Big Think. Will true AI turn against us? Do we have free will?
Read more >
Top 10 Questions Students ask about ACC Library Services
Top 10 Questions Students ask about ACC Library Services. 1. Where can I get help with finding information for my paper? Come by...
Read more >
Asking Good Reference Questions - How to Do Library ...
Background questions often include words such as "about," "history of," "basic information," "some," etc. "Who," "what," "when," and "where" are often used. " ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found