I only searched for infos in this community and first time to actually ask something. Please know that I'm new to android programming and also am not good at English.
I'm using canvas to draw a bitmap. I first select color and shape type with dialog. As I touch the screen, the bitmap gets drawn by the color I selected and shape (actually bitmap). The problem happens when I change the color or brush. After changing, when I draw, all the previously drawn bitmap's color and shape changes to new settings.
This is the code and an example image (since my bad english might confused you what I'm talking about). Obviously, it runs by invalidate().
protected void onDraw(Canvas canvas) {
for (int i = 0; i < mPoints.size(); i += 2) {
mPaint = new Paint();
MyPointWColor myP = mPoints.get(i);
mPaint.setColor(myP.color);
Bitmap resized = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getResources(), brush[brushNum]), 100, 100, true);
replaceColor_self(resized, mCurColor);
canvas.drawBitmap(resized,myP.x,myP.y,mPaint);
}
}
I really had hard time getting all this way. This last part will end this nightmare.
Please, save me!