lewisje / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Stretched images have no smoothing #465

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Scaling an image has no smoothing

What is the expected output? What do you see instead?
Michael wants smoothing. There is no smoothing.

Please use labels and text to provide additional information.

From svgweb user group:

I am currently working on an SVG map that has a bitmap background, see here

http://vis.uell.net/nrw/10/atlas.html

The bitmap image needs to be linked from within the SVG for proper
zooming like so

<image xlink:href="nrw_topo_ui.jpg" ... />

This works without a hitch but image quality is a lot worse in the
flash renderer than native (you might want to use the transparency
'slider' to reduce opacity of the SVG part of the map to witness the
quality degradation).

I am aware that bitmap scaling in Internet Explorer doesn't use
bicubic by default and with css one would use the following to get
smooth scaling

img { -ms-interpolation-mode:bicubic; }

Is there something similar in flash and if so how could it be triggered?

Thanks in advance
Michael Neutze

Rick here. This patch provides the desired results:
Index: src/org/svgweb/nodes/SVGImageNode.as
===================================================================
--- src/org/svgweb/nodes/SVGImageNode.as    (revision 1058)
+++ src/org/svgweb/nodes/SVGImageNode.as    (working copy)
@@ -148,6 +148,7 @@
             }
             this.bitmapData = null;
             bitmap.opaqueBackground = null;
+            bitmap.smoothing = true;

             drawSprite.addChild(bitmap);
             this.finishDrawNode();

I'm going to go ahead and add this since it seems to have no downside. If
someone does not want smoothing then we can implement one of the SVG
quality hints that control this. I am not inclined to implement that right now.

Original issue reported on code.google.com by grick23@gmail.com on 28 Mar 2010 at 9:20

GoogleCodeExporter commented 8 years ago
Fixed in r1059.

Original comment by grick23@gmail.com on 28 Mar 2010 at 9:22