I tried adding 10dp padding to the imageview padding with hardware
acceleration but the rendering artifact is still showing up.  The
artifact is not actually attached to the image being rotated in the
view; it's a type of ghosting artifact that is appearing outside of
the image itself. (A single dashed line that seems to follow the
amount of rotation of the imageview itself)

Here is the layout that is the problem:

        <!-- sizes only used for scaling ratio -->
        <RelativeLayout
                xmlns:android="http://schemas.android.com/apk/res/android";
                android:id="@+id/issue_cover_container"
                android:layout_marginTop="@dimen/grid_image_top_padding"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >

                <ImageView
                        android:id="@+id/b1"
                        android:rotation="5"
                style="@style/GridImage" />

                <ImageView
                        android:id="@+id/b2"
                        android:rotation="-5"
                style="@style/GridImage" />

                <ImageView
                        android:id="@+id/normal"
                        style="@style/GridImage" />

...

And the style:

        <style name="GridImage" >
        <item name="android:layout_width">0.75in</item>
        <item name="android:layout_height">0.95in</item>
                <item name="android:scaleType">fitCenter</item>
                <item 
name="android:paddingLeft">@dimen/grid_image_padding</item>
                <item 
name="android:paddingRight">@dimen/grid_image_padding</item>
                <item name="android:layout_centerInParent">true</item>
                <item name="android:layerType">hardware</item>
        </style>

On Apr 26, 4:51 pm, Romain Guy <romain...@android.com> wrote:
> To get antialiased edges with HW acceleration on you should add an empty 1px
> border in your bitmap (layer off) or 1 px padding in your ImageView (layer
> on).
>
> On Tue, Apr 26, 2011 at 4:17 PM, Christopher Lester 
> <whichsh...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > Hey folks
>
> > I am building an application and the following 3 scenarios occur.
>
> > 1. When I have hardware acceleration in the manifest turned on,
> > hardware layers enabled in my layout.xml file and a rotation applied
> > to an ImageView I get jaggies around the edges of the ImageView that
> > is holding the Bitmap.
>
> > 2. When I have hardware acceleration in the manifest turned on,
> > hardware layers dis-abled in my layout.xml file and a rotation applied
> > to an ImageView I get black borders around the edges of the ImageView
> > that is holding the Bitmap.
>
> > 3. When I have hardware acceleration turned off, hardware layers dis-
> > abled, and the ImageViews rotated I get some kind of jaggedness added
> > to the ImageView images themselves. Essentially they are not smooth
> > and crisp (ANTI_ALIAS).
>
> > I am trying to work out a scenario where I can have hardware
> > acceleration = on, no black edges around the ImageViews bitmaps, and
> > anti_aliased rotated imageviews. Clean and Crisp rotations.
>
> > Thanks for any help
>
> > Chris
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to