Results 1 to 5 of 5

Thread: writing random data into image

  1. #1
    Join Date
    Nov 2013
    Posts
    10
    Thanks
    8
    Platforms
    MacOS X Unix/X11 Windows Android

    Default writing random data into image

    Hi,

    How to write random data (like 1, 2, a, b..etc) in image file programmatically? It should be able to open in viewer after editing.

    Thanks,
    av.

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: writing random data into image

    Check the QImage class documentation, it has some methods to access the pixel data (setPixel(), scanLine(), etc ...).

    // edit: previous comments removed, i think i misunderstood the question probably you mean random access, not random values
    Last edited by stampede; 17th November 2013 at 16:27.

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

    av2306 (18th November 2013)

  4. #3
    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: writing random data into image

    If you mean that you want to see those characters in the image, e.g. have they "1" symbol visible in an image viewer, then look at QPainter, specifically QPainter::drawText()

    Cheers,
    _

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

    av2306 (19th November 2013)

  6. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: writing random data into image

    Are you talking about steganography ?

  7. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: writing random data into image

    (...) data (like 1, 2, a, b, ...)
    OMG I thought about hex values

Similar Threads

  1. semi-random crashes in QByteArray::data()
    By tuli in forum Qt Programming
    Replies: 10
    Last Post: 27th May 2013, 22:24
  2. QSerial problem:receives random data
    By omegaKnot in forum Qt Programming
    Replies: 5
    Last Post: 27th May 2011, 09:32
  3. Replies: 2
    Last Post: 24th January 2011, 19:40
  4. Replies: 1
    Last Post: 7th April 2010, 16:26
  5. Writing Data Aware Forms in QT4.
    By gsQT4 in forum Qt Programming
    Replies: 5
    Last Post: 21st March 2007, 10:35

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.