CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2000
    Location
    andhrapradesh,India
    Posts
    4

    screen capture in java

    I have to capture the desktop screen.I have tried with jdk1.3
    beta java.awt.robot but it has given an error.i am now trying
    with VC getDesktopWindow method of win32 api.Still i am not
    getting that. I would be greatly thankful to you if you provide
    me with a workable solution.thanks in advance.

    Narayan

    narayan rallabandi murthy

  2. #2
    Join Date
    May 1999
    Location
    13 N 77 E
    Posts
    183

    Re: screen capture in java

    There is no direct WIN32 api for screen capture, you need to createCompatibleDC with the DC of the window to capture and BitBlt the data into the new DC and save to file with CreateBitmap and BITMAP HEADER info included. Look at the code in the VC++ discussion.


  3. #3
    Join Date
    Mar 2000
    Posts
    123

    Re: screen capture in java

    Try this:

    public void actionPerformed(ActionEvent e) {
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    } catch (Exception prt) {
    System.err.println(prt.getMessage());
    }
    }
    }



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured