[SGS II] Need help with android graphics problem [Archive] - Samsung Galaxy S Forums : Galaxy S2 S II Forum

: [SGS II] Need help with android graphics problem



nvingenieria
12-06-2011, 12:11 PM
Hi all,

I'm new to the forum and need someone having a SGS II helps me.

I'm facing a problem developing an application that seems to only affect this terminal (SGS II), but I don't have access to one, so I hope someone can help.

The problem is very simple to reproduce. You just need to draw a square or any other graphic shape with Android Graphics library (not tested with Open GL since this is not an option for this app). What you can see is a 1px border a bit darker that the shape fills. This is not visible at first look, but it is there, and it is important for the application I'm developing.

I coded a simple test application to demonstrate this. You can download apk file from: www.danielnavarroymas.com/apps/test.apk (http://www.danielnavarroymas.com/apps/test.apk)

Also you can access the project source if needed at www.danielnavarroymas.com/apps/test.rar (http://www.danielnavarroymas.com/apps/test.rar)

The code is really simple: only the main.xml which is a RelativeLayout with a custom view that draws a red Rect in onDraw function.

Please, I really need some help at this... We can reach an agreement if anyone identifies the problem and provides a solution.

Thanks in advance,
Daniel


LAYOUT

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFFFF">

<com.nvingenieria.test1.Vista
android:id="@+id/surf"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFFFF" />

</RelativeLayout>


CUSTOM VIEW

@Override
public void onDraw(Canvas c) {
Paint p = new Paint();
Rect r = new Rect(50, 100, 150, 200);

// Dibujamos
p.setColor(Color.RED);
p.setStyle(Style.FILL);
p.setAntiAlias(false);
c.drawRect(r, p);
}