Hi,

I tried QTextStream


QPixmap p(scn3->width(),scn3->height());
QPainter paint(&p);
paint.setRenderHint(QPainter::Antialiasing);
paint.setRenderHint(QPainter::SmoothPixmapTransfor m);
scn3->render(&paint);
QImage img=p.toImage();
int width=img.width();
int height=img.height();
int *matrix[width][height];
for(int j=0;j<height;j++)
{
for (int i=0;i<width;i++)
{
*matrix[width][height]=qGray(img.pixel(i,j));
QFile file("/Users/venkateshpadmanabhan/Desktop/out1.txt");
file.open(QIODevice::WriteOnly);
QTextStream tex(&file);
tex<<matrix;
file.close();
endl(tex);
}

But the application gets crashing....