Android - Toile drawLine à l'intérieur de ImageView
J'ai une ImageView dans laquelle je veux dessiner une Ligne. J'ai fait le suivi:
mImagenCampo = (ImageView) findViewById(R.id.imagen_campo);
crearPunto(mArea9M, mPaloIzq,v.getWidth(), mPaloIzq,Color.WHITE);
Et la fonction est:
private void crearPunto(float x, float y, float xend, float yend, int color) {
BitmapDrawable bmpDraw = (BitmapDrawable) mImagenCampo.getDrawable();
Bitmap bmp = bmpDraw.getBitmap().copy(Config.RGB_565, true);
Canvas c = new Canvas(bmp);
Paint p = new Paint();
p.setColor(color);
c.drawLine(x, y, xend, yend, p);
mImagenCampo.setImageBitmap(bmp);
}
Mon problème est que la ligne est tracée, mais Il n'a pas obtenir les droits de coordonnées. Il est tiré inférieure à ce qu'Elle devrait être.
Grâce
Edit: j'ai oublié de dire que mImagenCampo est une ImageView
OriginalL'auteur gutiory | 2011-12-09
Vous devez vous connecter pour publier un commentaire.
Essayez ceci:
OriginalL'auteur slybloty