संभव डुप्लिकेट:
how to make screen screenshot with win32 in c++?स्क्रीन का हिस्सा कैप्चर कैसे करें और इसे बीएमपी में कैसे सहेजें?
मैं वर्तमान में है कि एक bmp करने के लिए स्क्रीन के एक हिस्से को बचाया एक आवेदन बनाने के लिए कोशिश कर रहा हूँ। मुझे BitBlt मिला है लेकिन मुझे नहीं पता कि इसके साथ क्या करना है। मैंने कुछ उत्तरों की तलाश करने की कोशिश की है लेकिन मुझे अभी भी सी ++ का उपयोग करके स्पष्टीकरण नहीं मिला है।
तो, मूल रूप से मैं इस समारोह चाहते हैं:
bool capturePartScreen(int x, int y, int w int, h, string dest){
//Capture part of screen according to coordinates, width and height.
//Save that captured image as a bmp to dest.
//Return true if success, false if failure
}
BitBlt:
BOOL BitBlt(
__in HDC hdcDest,
__in int nXDest,
__in int nYDest,
//The three above are the ones I don't understand!
__in int nWidth,
__in int nHeight,
__in HDC hdcSrc,
__in int nXSrc,
__in int nYSrc,
__in DWORD dwRop
);
कि hdc क्या होना चाहिए और मैं bmp कैसे प्राप्त करते हैं?
देखो (http://stackoverflow.com/questions/3291167/how-to-make-screen-screenshot -साथ-Win32-इन-सी)। –
यह [प्रश्न] देखें (http://stackoverflow.com/questions/5292700/efficiently-acquiring-a-screenshot-of-the-windows-desktop), यह आपको सही दिशा में इंगित करना चाहिए –
@ जेसे: धन्यवाद , उस पोस्ट ने मुझे थोड़ा सा मदद की :) – Anton