#coding = utf-8
# file_name = test2.py
from PyQt4 import QtCore, QtGui
im.setColorTable([QtCore.Qt.black, QtCore.Qt.white, QtCore.Qt.red])
im.setPixel(1, 2, 0)
im.setPixel(2, 1, 1)
im.setPixel(0, 2, 2)
im.save('/home/grissiom/im.png')
#coding = utf-8
# file_name = test2.py
from PyQt4 import QtCore, QtGui
im = QtGui.QImage(10, 10, QtGui.QImage.Format_Indexed8)
im.setColorTable([QtCore.Qt.black, QtCore.Qt.white, QtCore.Qt.red])
im.setPixel(1, 2, 0)
im.setPixel(2, 1, 1)
im.setPixel(0, 2, 2)
im.save('/home/grissiom/im.png')
To copy to clipboard, switch view to plain text mode
but the image is totally black. How could I fix it? Thanks in advance ;)
Bookmarks