[vtkusers] How to print VtkBmpWriter

David Doria daviddoria at gmail.com
Fri Oct 5 08:39:21 EDT 2012


On Fri, Oct 5, 2012 at 8:34 AM, Farid Dshabarow <f.dshabarow at gmail.com> wrote:
> Because I want to print the image in QT, I am doing something like this
>
>
>     QPrinter printer;
>
>     QPrintDialog *dialog = new QPrintDialog(&printer);
>
>     dialog->setWindowTitle(tr("Print Document"));
>
>     if (dialog->exec() != QDialog::Accepted) {
>
>         return;
>
>     }
>
>     QImage testbild("C:\\Users\\dshabarow\\Desktop\\c.bmp");
>
>     QPainter painter(&printer);
>
>     painter.drawImage(QPoint(0, 0), testbild);
>
>     painter.end();
>
>
>
> But instead of creating an image from a bitmap file and then giving it to
> the QPainter,
>
> I want to create an image from the "pixel data". You can create an image by
> giving
>
> a pointer to the unsigned char data.
>
> My problem is how to connect now vtkbmpwriter output with the QT image
> input.

Please keep the discussion on the mailing list.

Like I said, there is nothing "output" from the writer - so to get the
image data you will need the input to the writer. The raw data can be
obtained using vtkImageExport.

David



More information about the vtkusers mailing list