screenshot in Win7

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?

screenshot in Win7

Postby bal » Wed Feb 18, 2015 5:11 pm

How to take screenshot in Win7?
bal
 
Posts: 3
Joined: Wed Feb 18, 2015 5:08 pm

Re: screenshot in Win7

Postby xytroxon » Thu Feb 19, 2015 7:29 am

Two programs I have used are:

1: ConEmu: Press Win + H keys to save its console display to a jpg file.
http://code.google.com/p/conemu-maximus5/

ConEmu-Maximus5 is a Windows console emulator with tabs, which presents multiple consoles and simple GUI applications as one customizable GUI window with various features.


2: FreeCpmmander: "Tool" menu has a screenshot option. (bmp png gif)
http://freecommander.com/en/summary/

FreeCommander is an easy-to-use alternative to the standard windows file manager. The program helps you with daily work in Windows. Here you can find all the necessary functions to manage your data.


Both programs are part of my newLISP Windows command line programming tool set ;>)

-- xytroxon
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976
xytroxon
 
Posts: 295
Joined: Tue Nov 06, 2007 3:59 pm

Re: screenshot in Win7

Postby bal » Thu Feb 19, 2015 10:35 am

I do not need to save the image to a file, I want to analyze it programmatically. Something similar to this:

Code: Select all
typedef struct point {
    int x;
    int y;
} Point;

Point points[] = {
    { 1, 10 },
    { 20, 3 },
    { 640, 480 },
    { 0, 0 }
};

COLORREF colors[4];

HDC h = GetDC(NULL); // handle of desktop
for( int i = 0; i < 4; i++ ) {
    colors[i] = GetPixel(h, points[i].x, points[i].y);
}
ReleaseDC(h);
bal
 
Posts: 3
Joined: Wed Feb 18, 2015 5:08 pm

Re: screenshot in Win7

Postby kosh » Thu Feb 19, 2015 1:18 pm

Try translate to newLISP:

Code: Select all
(import "user32" "GetDC")       ; HDC GetDC(HWND hWnd);
(import "user32" "ReleaseDC")   ; int ReleaseDC(HWND hWnd, HDC hDC);
(import "gdi32" "GetPixel")     ; COLORREF GetPixel(HDC hdc, int nXPos, int nYPos);

(define (get-pixel point)
  (letn ((h (GetDC 0))
         (color (GetPixel h (first point) (last point))))
    (ReleaseDC h)
    color))

(print (map get-pixel '((1 10)
                        (20 3)
                        (640 480)
                        (0 0))))
;;-> (0 4144700 14548991 0)
Last edited by kosh on Thu Feb 19, 2015 2:54 pm, edited 1 time in total.
kosh
 
Posts: 67
Joined: Sun Sep 13, 2009 5:38 am
Location: Japan

Re: screenshot in Win7

Postby bal » Thu Feb 19, 2015 1:41 pm

Wow, it looks so amazing and easy! :) So, may be I move some my number-crunchers to C-DLLs. ;) Thanks!
bal
 
Posts: 3
Joined: Wed Feb 18, 2015 5:08 pm


Return to newLISP and the O.S.

Who is online

Users browsing this forum: No registered users and 1 guest

cron