Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, October 2007
BitBlt problems.


Message 1 in thread

   Greetings,

   We were using BitBlt for drawing images in our source code. We stayed
with Qt3 as much as possible, but now we're porting to Qt4 and a problem
appeared: we've read the Assistant, however QPainter isn't a option for
replacing BitBlt in our case - the images are too big, and now everything is
very slow. We must use 8-bit images, so... can anyone please tell us
anything we can do to solve this problem?

   Thank you.

Message 2 in thread

Hi,

>    We were using BitBlt for drawing images in our source code. We stayed 
> with Qt3 as much as possible, but now we're porting to Qt4 and a problem 
> appeared: we've read the Assistant, however QPainter isn't a option for 
> replacing BitBlt in our case - the images are too big, and now 
> everything is very slow. We must use 8-bit images, so... can anyone 
> please tell us anything we can do to solve this problem?

What are you exactly bitBlt'ing? Where from? Where to? I guess you have read 
and applied this:
	http://doc.trolltech.com/4.3/porting4.html#qpaintdevice

It's hard to tell what's going wrong with your use case without more details 
or some example that reproduces the problem.

--
 [ signature omitted ] 

Message 3 in thread

Greetings, and thank you for answering.

  We're blitting from a loaded QImage, generally in high resolution (like
3000 x 3000 and up), 8-bit depth and 256 color pallete. The destination is
another QImage, same size and depth, shown on screen. This worked fine on
Qt3, but now we only get black images due to BitBlt's new 32-bit limitation.
We've tried QPainter::drawImage, and it's perfectly fine if we use small
images, but that's not our case. For some reason, blitting into the painter
gives us very slow results, specially when the image resolution goes around
10000 x 10000.
  Our first idea was to make a new BitBlt from scratch, but asking here for
ideas looked better. Our software is very graphics-oriented, and we can't
have it at around 1 fps. Any ideas will be highly aprecciated.

  And sorry... our code is so messy right now it's almost impossible pasting
any part of it here. Even we can't understand some parts of it... it's awful
having to clean other people's room. We're not the original programmers.

  Thank you!


2007/10/18, Dimitri <dimitri@xxxxxxxxxxxxx>:
>
> Hi,
>
> >    We were using BitBlt for drawing images in our source code. We stayed
> > with Qt3 as much as possible, but now we're porting to Qt4 and a problem
> > appeared: we've read the Assistant, however QPainter isn't a option for
> > replacing BitBlt in our case - the images are too big, and now
> > everything is very slow. We must use 8-bit images, so... can anyone
> > please tell us anything we can do to solve this problem?
>
> What are you exactly bitBlt'ing? Where from? Where to? I guess you have
> read
> and applied this:
>         http://doc.trolltech.com/4.3/porting4.html#qpaintdevice
>
> It's hard to tell what's going wrong with your use case without more
> details
> or some example that reproduces the problem.
>
> --
> Dimitri
>
> --
> 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/
>
>

Message 4 in thread

Hi,

>   We're blitting from a loaded QImage, generally in high resolution 
> (like 3000 x 3000 and up), 8-bit depth and 256 color pallete. The 
> destination is another QImage, same size and depth, shown on screen. 

It shouldn't be important that the second QImage is shown on the screen. Why 
not simply use QImage::copy() anyway? Is the destination a QPixmap instead of 
a QImage?

Showing just a few lines of the code would really help.

> This worked fine on Qt3, but now we only get black images due to 

Note that bitBlt() is documented to have always been "inefficient for non 
32-bit images":
	http://doc.trolltech.com/3.3/qimage.html#bitBlt

> BitBlt's new 32-bit limitation. We've tried QPainter::drawImage, and 

Which exact 32-bit limitation? At least the documentation still describes 
bitBlt() as "inefficient for non 32-bit images":
	http://doc.trolltech.com/4.3/qimage-qt3.html#bitBlt

--
 [ signature omitted ]