J'ai réussi à "résoudre" mon problème en utlisant une méthode peu orthodoxe mais qui a le mérite de fonctionner :
Comme champ de ma classe héritant ImageView :
private final float shadowRadius = 1.0f;
private final int shadowOffset = 1;
private final int shadowColor = 0xffffffff;
et dans le onDraw(Canvas canvas)
this.p.setShadowLayer(this.shadowRadius, this.shadowOffset, this.shadowOffset, this.shadowColor);
canvas.drawText(this.text, this.posx, this.posy, this.p);
this.p.setShadowLayer(this.shadowRadius, this.shadowOffset, -this.shadowOffset, this.shadowColor);
canvas.drawText(this.text, this.posx, this.posy, this.p);
this.p.setShadowLayer(this.shadowRadius, -this.shadowOffset, this.shadowOffset, this.shadowColor);
canvas.drawText(this.text, this.posx, this.posy, this.p);
this.p.setShadowLayer(this.shadowRadius, -this.shadowOffset, -this.shadowOffset, this.shadowColor);
canvas.drawText(this.text, this.pos, this.posy, this.p);
}
En gros je dessine 4x mon texte, et pour chaque fois je lui applique une ombre dans une direction.
Modifié pour la dernière fois par Viish (08/02/2010 19:57:33)