Results 1 to 2 of 2

Thread: get a ptr of raw data from screen shot

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default get a ptr of raw data from screen shot

    I get a screen shot with this code:
    Qt Code:
    1. QPixmap originalPixmap = QPixmap::grabWidget(this);
    2. QImage *image = new QImage(originalPixmap.toImage());
    3. image->save("/home/saman/Desktop/image.png");
    To copy to clipboard, switch view to plain text mode 

    Now, I want to send raw data grabbed from grabWidget over the socket. On the other end, machine receives this raw data and creates a gl texture of it.

    As you see, the return value of grabWidget is a QPixmap, I also checked the method data_ptr(), which I think returns what I want with DataPtr format. this format is not recognizable by the compiler though! any idea how to resolve this?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: get a ptr of raw data from screen shot

    You are looking for QImage::bits()

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    saman_artorious (11th August 2013)

Similar Threads

  1. Replies: 6
    Last Post: 21st November 2012, 18:54
  2. Get Data on Screen (from Internet or Software)
    By manuelito2459 in forum Newbie
    Replies: 1
    Last Post: 29th December 2011, 21:36
  3. Getting raw touch screen data.
    By mahdi75 in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2011, 08:42
  4. Replies: 2
    Last Post: 11th June 2010, 07:23
  5. QTimer single shot and too busy app.
    By Pier in forum Qt Programming
    Replies: 3
    Last Post: 20th March 2007, 14:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.