Метод Android Canvas.drawPoint ничего не рисуетAndroid

Форум для тех, кто программирует под Android
Anonymous
Метод Android Canvas.drawPoint ничего не рисует

Сообщение Anonymous »

Я работаю с Canvas.drawPoint(float, float, Paint), но обнаружил странную вещь: этот метод не работает.
Сначала я подумал, что это проблема с моим кодом, поэтому написал простой тестовый код:

Код: Выделить всё

public class TestView extends View {

Paint paint = new Paint();

public TestView(Context context) {
super(context);
}

public TestView(Context context, AttributeSet attrs) {
super(context, attrs);
}

public TestView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

@Override
protected void onDraw(Canvas canvas) {
paint.setColor(Color.BLACK);
canvas.drawRect(200, 200, 300, 300, paint);   //works well

paint.setColor(Color.GREEN);
for(int x = 300; x 

Подробнее здесь: [url]https://stackoverflow.com/questions/79100818/android-canvas-drawpoint-method-draws-nothing[/url]

Вернуться в «Android»