Open GoogleCodeExporter opened 9 years ago
So do you mean it does enlarge, but you want it to stretch to exactly fit both
width and height?
Keeping the aspect ratio is the default behaviour. If you want it to do the
stretch, try adding the following to your code:
siv.setScaleType(ScaleType.FIT_XY);
I think it should do what you want.
Original comment by paul.leb...@gmail.com
on 7 Jul 2014 at 10:28
For some reason, the image doesn stretch to the parameters I give it. I'd like
the image stretch like the attachment.
Thanks
Original comment by thaedne...@gmail.com
on 8 Jul 2014 at 2:51
Attachments:
Hi thaenevol
Did you try my suggestion? What happened?
Original comment by paul.leb...@gmail.com
on 8 Jul 2014 at 9:06
Hi. Yes. I've attached two files, one with fitxy and the other with center. It
'cuts' the image...
Original comment by thaedne...@gmail.com
on 8 Jul 2014 at 8:41
Attachments:
Hi. Based on this: https://code.google.com/p/svg-android/issues/detail?id=7 I
tried with:
public class CustomPictureDrawable extends PictureDrawable {
private float scalex, scaley;
public CustomPictureDrawable(Picture picture, float scalex, float scaley) {
super(picture);
this.scalex = scalex;
this.scaley = scaley;
}
@Override
public void draw(Canvas canvas) {
Matrix original = canvas.getMatrix();
canvas.scale(scalex, scaley);
super.draw(canvas);
canvas.setMatrix(original);
}
}
In SVGImageView.java
But the image is still in the center.
Original comment by thaedne...@gmail.com
on 9 Jul 2014 at 4:01
I see the same behaviour using this XML definition:
<com.caverock.androidsvg.SVGImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="@string/content_desc_overlay"
android:scaleType="fitXY"
svgimageview:svg="@raw/thirds" />
Original comment by o...@itmaze.com.au
on 3 Oct 2014 at 2:55
anyone find solution for this ? thx
Original comment by fadimoa...@gmail.com
on 11 Apr 2015 at 12:20
Original issue reported on code.google.com by
thaedne...@gmail.com
on 7 Jul 2014 at 10:06Attachments: