qt-interest@trolltech.com
[Top] [All Lists]

Re: paint in picture does not work?

Subject: Re: paint in picture does not work?
From: Keith Esau
Date: Wed, 21 Mar 2007 14:07:14 -0700
Can I assume you are doing something like this to display it?

void MyWidget::paintEvent(QPaintEvent*)
{
    QPicture    picture;
    QPainter    painter(this);
    picture.load("drawing.pic");    // load picture
    painter.drawPicture(0, 0, picture);  // draw the picture at (0,0)
}

Or are you trying to load it in another application somewhere? This creates
a Qt specific format file.

Keith

On 03-21-2007 11:36 AM, "Lingfa Yang" wrote:

> Does anyone know why paint in picture does not work?
> 
>     QPicture picture;
>     QPainter painter;
>     painter.begin(&picture);           // paint in picture
> 
>     painter.drawEllipse(0,0, 512, 320); // draw an ellipse
> 
>     painter.end();                     // painting done
> 
>     bool ok = picture.save("drawing.pic");  // save picture
> 
> Though ok is true, and the pic file is created, but it seems NOT a valid
> pic file. Why?
> I use Qt4.1.1 in windows
> 
> Lingfa


--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>