Results 1 to 2 of 2

Thread: Offset of a pixmap image

  1. #1
    Join Date
    Apr 2011
    Posts
    231
    Thanks
    141
    Thanked 6 Times in 5 Posts

    Default Offset of a pixmap image

    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?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Offset of a pixmap image

    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 -

    Qt Code:
    1. MyWidget::paintEvent()
    2. {
    3. QWidget::paintEvent(event);
    4. QPainter painter(this);
    5. drawIconsOverlay(&painter);
    6. }
    To copy to clipboard, switch view to plain text mode 

    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.

Similar Threads

  1. Load image to pixmap from internet
    By metRo_ in forum Qt Programming
    Replies: 1
    Last Post: 21st August 2010, 07:08
  2. Draw Image into Pixmap/Image
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 19th May 2010, 06:56
  3. pixelized png image loaded as a pixmap
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2009, 11:56
  4. [problem]displaying image with Pixmap
    By crazy_inf in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2008, 09:49
  5. Qt 3.3.8 pixmap to/from image error
    By ksierens in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2008, 06:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.