Изображение не отображается должным образом, когда я настраиваю растровое изображение для настраиваемого небольшого экрана.
public class CustomViewVerticle extends View {
Paint redPaint = new Paint();
Paint bluePaint = new Paint();[![side corner not showing][1]][1]
Paint greenPaint = new Paint();
Bitmap tile;
private void init() {
redPaint.setColor(Color.BLACK);
bluePaint.setColor(Color.RED);
}
public CustomViewVerticle(Context context) {
super(context);
init();
}
public CustomViewVerticle(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init();
}
public CustomViewVerticle(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
public void setBitmap(Bitmap tileImage){
tile=tileImage;
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Path p=new Path();
p.moveTo(0,0);
p.moveTo(getWidth(),getWidth());
p.lineTo(getWidth(),getHeight()-getWidth());
p.lineTo(0,getHeight());
p.lineTo(0,0);
p.close();
if(tile!=null) {
Shader shader = new BitmapShader(tile, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
redPaint.setShader(shader);
redPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
}
canvas.drawPath(p,redPaint);
// canvas.drawPath(animPath,bluePaint);
}
}
Это мое настраиваемое представление
Bitmap hori = Bitmap.createBitmap(hori_wid``th, frameWidth, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(hori);
captureImage.draw(c);
CustomViewVerticle cvTop;
cvTop.setBitmap(hori);
, поэтому я настраиваю растровое изображение, но на большом экране. размер телефона работает отлично, но он поставляется в небольшом экране, он работает отлично ![image preview in big screen phone](https://i.stack.imgur.com/l4ljF.png)
[1]: https://i.stack.imgur.com/ielVi.jpg
так что, наконец, моя проблема заключается в том, что на маленьких устройствах изображение не показывает свой угол