I'm writing here now because the other sub forums seem to be flooded ....
i have a project where i have to place ressources (.png files) on a view. These ressources shall replace the self-drawed android.graphics.Picture objects on the view. The pictures are built up and passed on the following way:
- Code: Select all
picture = new Picture();
canvas = picture.beginRecording(0, 0);
Reference.paint.setColor(getResources().getColor(R.drawable.col_listener));
Reference.paint.setStrokeWidth(3.0f);
canvas.drawLine(-12.0f, 0.0f, 13.0f, 0.0f, Reference.paint);
Reference.paint.setStrokeWidth(2.0f);
canvas.drawLine( 15.0f, 0.0f, -1.0f, -10.0f, Reference.paint);
canvas.drawLine( 15.0f, 0.0f, -1.0f, 10.0f, Reference.paint);
picture.endRecording();
Reference.arrowPicture = picture;
at the Reference class its processed like this:
- Code: Select all
@Override
public void draw(Canvas canvas, float inverseScaling, float counterRotation) {
canvas.save();
canvas.scale(inverseScaling, -inverseScaling);
arrowPicture.draw(canvas);
canvas.restore();
}
Instead of the drawn picture i want a given ressource file to be processed instead and to be drawn on the canvas.
Does anyone have an smart solution for that?
Greetz


