0
Ich mag zeichnen Bild auf Top in jedem Bogen von CanvasWie Bitmap-Bild auf der Oberseite in Bogen
private void drawImage(Canvas canvas, float tempAngle, Bitmap bitmap,String mValue) {
//get every arc img width and angle
int imgWidth = (radius/mWheelItems.size());
//int imgWidth = (radius/3);
float angle = (float) ((tempAngle + 360/mWheelItems.size() /2) * Math.PI/180);
//calculate x and y
int x = (int) (center + radius/2/2 * Math.cos(angle));
int y = (int) (center + radius/2/2 * Math.sin(angle));
int top=y - imgWidth/2;
int bottom=y +imgWidth/2;
int left=x - imgWidth /2;
int right=x + imgWidth/2;
Rect rect = new Rect(left, top, right, bottom);
final Rect rect1 = new Rect(x - imgWidth /2 , y - imgWidth/2 , bitmap.getWidth() , bitmap.getHeight());
canvas.drawBitmap(bitmap, null, rect, null);
}
Arc wird entsprechend die Größe der Elemente
Das Ergebnis wird gezeigt, wie zeichnen dass
Aber will ich das Bild Bitmap auf wie die von rect gezeigt. Red wollen auch große Größe von Bildern oder Bitmap
Bitte lesen Sie es vor Downvote –