>From what I've read, the support for (geo-tagged) photos is fairly new.
But somehow I've got the impression that it's more of a technology
preview. Zooming behaves unforeseeable at extreme values and it has no
limits. The image is drawn in poor quality and the filename doesn't even
begin to fit in the small dock window. Also, moving the image in the
view takes 100% CPU because it's recreated in every paint event.

So this is a partial fix to improve the situation. It adds anti-aliasing
to the display (much better reabability of street name signs now at any
zoom level) and shortens the filename by cutting off the path. It does
not address handling or performance flaws. The latter would possibly
require wide rewriting of the zoom and pan code. (Or maybe not, if I
only understood what it does.)

The photos support is very important to me because this is the way I'm
making notes in the field. Without this feature, I'm doing very hard
knowing what I've seen where. Also, I'm not actually deciding on
tracktypes when I'm there, but I just take a photograph of it and then
compare it with the tracktypes reference at the computer.

-- 
Yves Goergen "LonelyPixel" <[email protected]>
Visit my web laboratory at http://beta.unclassified.de
--- merkaartor\GeoImageDock.cpp.orig    Fri Jan 02 23:21:14 2009
+++ merkaartor\GeoImageDock.cpp Mon Jan 05 20:59:32 2009
@@ -316,9 +316,15 @@
 
 void ImageView::setImage(QString filename)
 {
-       name = filename;
-       if (!name.isEmpty())
-               image.load(name);
+       int i = filename.lastIndexOf("\\");
+       if (i == -1)
+               i = filename.lastIndexOf("/");
+       if (i != -1)
+               name = filename.mid(i + 1);
+       else
+               name = filename;
+       if (!filename.isEmpty())
+               image.load(filename);
        else
                image = QPixmap();
        area = QRect(QPoint(0, 0), image.size());
@@ -330,12 +336,15 @@
 {
        QPainter P(this);
 
-       P.drawPixmap(rect, image.copy(area));
+       P.drawPixmap(rect, image.copy(area).scaled(rect.width(), rect.height(), 
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
 
        QFontMetrics metrics(P.font());
        QRect text = metrics.boundingRect(name);
+       text.setRight(text.right() + 4);
        text.translate(-text.topLeft());
-       P.fillRect(text, QColor(255, 255, 255));
+       P.fillRect(text, QColor(255, 255, 255, 192));
+       text.setLeft(text.left() + 2);
+       text.setRight(text.right() - 2);
        P.drawText(text, name);
 }
 
_______________________________________________
Merkaartor mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/merkaartor

Reply via email to