Cách chụp hình một form trong .NET

Cách chụp hình 1 form rồi đưa ra file dạng { enum ImageFormat } . ở đây ví dụ file *.jpeg [("")] // Lấy API ra :D private static extern bool BitBlt( IntPtr hdcDest, // handle to destination DC int nXDest, // x-coord of destination upper-left corner int nYDest, // y-coord of destination upper-left corner int nWidth, // width of destination rectangle int nHeight, // height of destination rectangle IntPtr hdcSrc, // handle to source DC int nXSrc, // x-coordinate of source upper-left corner int nYSrc, // y-coordinate of source upper-left corner dwRop // raster operation code ); //. | Cách chụp hình một form trong .NET Cách chụp hình 1 form rồi đưa ra file dạng enum ImageF ormat . ở đây ví dụ file jpeg Lấy API ra D private static extern bool BitBlt IntPtr hdcDest handle to destination DC int nXDest x-coord of destination upper-left corner int nYDest y-coord of destination upper-left corner int nWidth width of destination rectangle int nHeight height of destination rectangle IntPtr hdcSrc handle to source DC int nXSrc x-coordinate of source upper-left corner int nYSrc y-coordinate of source upper-left corner dwRop raster operation code chép nguyên xi định nghĩa cho dễ hiểu Lấy đối tượng IntPtr dc1 Tạo button rồi xử lý chụp hình form private void Button_Click object sender e Graphics g1 Image MyImage new Bitmap g1 Graphics g2 MyImage IntPtr dc1 IntPtr dc2 BitBlt dc2 0 0 dc1 0 0 13369376 dc1 dc2 @ c Capturedjpg Nguồn C Lấy OS Info Đoạn code khá đơn giản mà hữu hiệu using System class GetOSVersion static void GetOSVersion PlatformID pID Version ver OperatingSystem os new OperatingSystem pID ver PlatformID platform Version version Platform 0 -15 Version 1 platform version static void Main Your OS Information n GetOSVersion Nguồn .

Bấm vào đây để xem trước nội dung
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
23    94    1    05-07-2024
16    96    2    05-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.