views:

42

answers:

1

QT4 How to blur QPixmap image?

I am looking for something like one of the following:

Blur(pixmap); 
painter.Blur(); 
painter.Blur(rect);

What is the best way to do this?

+1  A: 

A Gaussian blur is a simple way to create a blurring effect.

Edit: And lo, I came across Qt's QGraphicsBlurEffect. Introduced in Qt 4.6, it seems to do exactly what you want.

gspr
I have no idea how to apply QGraphicsBlurEffect to pixmap...
Astronavigator
The QGraphicsEffects are meant to be applied to graphics views, not pixmaps. However, the general idea of a Guassian blur is the way to go; you'll just have to implement the algorithm yourself on the pixmap. (It might be faster/easier to convert to a QImage, though.)
Caleb Huitt - cjhuitt
Everybody knows these algorithms. But to implement them myselft i have to have way to : 1. convert QPixmap to 2d array 2. way to convert from 2d array back to pixmap. If your advise is to implement it myself, then tell how to convert between QPixmap and 2d array
Astronavigator