PDA

View Full Version : Offset of a pixmap image



TheIndependentAquarius
30th October 2013, 11:20
Suppose there is a google marker pin ballon shapped icon. I want to plot that icon on a map rendered through Qt.

I want that the tip of the icon should be placed at the desired coordinate in map.
How should I go about that?

aamer4yu
30th October 2013, 12:38
What type is Map ?
You can translate the map coordinates to widget coordinates and draw the icon.

Also if you have paintEvent(), you use a overlay for icons such as -


MyWidget::paintEvent()
{
QWidget::paintEvent(event);
QPainter painter(this);
drawIconsOverlay(&painter);
}

Also you will need to make some adjust to make the tip of icon appear on the point.
Say the tip is in middle of the icon png, you will need to shift / moveup the png so that its bottom is on the desired point.