PDA

View Full Version : writing random data into image



av2306
17th November 2013, 15:46
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.

stampede
17th November 2013, 17:14
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

anda_skoa
18th November 2013, 11:09
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,
_

aamer4yu
18th November 2013, 11:13
Are you talking about steganography ?

stampede
18th November 2013, 12:36
(...) data (like 1, 2, a, b, ...)
OMG I thought about hex values :p