The method drawBitmap(Bitmap, Rect, RectF, Paint) is ambiguo

Problems with Canvas, OpenGL, etc...

The method drawBitmap(Bitmap, Rect, RectF, Paint) is ambiguo

Postby qwertzuiop » Tue May 10, 2011 10:47 pm

Hi there

Any idea what this means: "The method drawBitmap(Bitmap, Rect, RectF, Paint) is ambiguous for the type Canvas" ?

Code: Select all
   Bitmap out = Bitmap.createBitmap(rect.right-rect.left, rect.bottom-rect.top, Bitmap.Config.ARGB_8888);
      Canvas c = new Canvas(out);
      Paint p = new Paint();
      c.drawBitmap(unten, rect, null, p); // error
...}


Maybe it has to do something with the method drawBitmap(Bitmap, Rect, Rect, Paint), where the Rect is of Integer-Type.

Thanks for the help
qwertzuiop
Freshman
Freshman
 
Posts: 4
Joined: Thu Mar 10, 2011 1:48 pm

Top

Re: The method drawBitmap(Bitmap, Rect, RectF, Paint) is amb

Postby qwertzuiop » Tue May 10, 2011 11:10 pm

I think, the problem is solved now.
The error only appears, if the third argument is set to null. Then there is no visible difference between the methods
drawBitmap(Bitmap, Rect, RectF, Paint) and drawBitmap(Bitmap, Rect, Rect, Paint).
qwertzuiop
Freshman
Freshman
 
Posts: 4
Joined: Thu Mar 10, 2011 1:48 pm

Re: The method drawBitmap(Bitmap, Rect, RectF, Paint) is amb

Postby bxm » Tue May 10, 2011 11:10 pm

There are two drawBitmap calls that your given paremeters could work for:

drawBitmap (Bitmap bitmap, Rect src, Rect dst, Paint paint)
drawBitmap (Bitmap bitmap, Rect src, RectF dst, Paint paint)

Since you are using null for the third parameter, I get the impression the compiler can't figure out which one you mean to use.

EDIT: Beat me to the punch!
bxm
Junior Developer
Junior Developer
 
Posts: 24
Joined: Tue May 10, 2011 2:51 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests