Open kangshifu opened 4 years ago
TextView textView = new TextView(getContext()); textView.setText("你好"); Drawable drawable = TBaseModuleApplication.getContext().getResources().getDrawable(R.drawable.water_mark_logo); textView.setCompoundDrawables(drawable,null,null,null); textView.setCompoundDrawablePadding(10); WatermarkText watermarkText = new WatermarkText(textView) .setPositionX(0.5) .setPositionY(0.5) .setTextColor(Color.WHITE) .setTextAlpha(98) .setRotation(-30) .setTextSize(14);
Watermark waterMark = WatermarkBuilder.create(TBaseModuleApplication.getContext(), bitmap) .setTileMode(true) .loadWatermarkText(watermarkText) .getWatermark();
设置后drawable图片没有绘制出来
TextView textView = new TextView(getContext()); textView.setText("你好"); Drawable drawable = TBaseModuleApplication.getContext().getResources().getDrawable(R.drawable.water_mark_logo); textView.setCompoundDrawables(drawable,null,null,null); textView.setCompoundDrawablePadding(10); WatermarkText watermarkText = new WatermarkText(textView) .setPositionX(0.5) .setPositionY(0.5) .setTextColor(Color.WHITE) .setTextAlpha(98) .setRotation(-30) .setTextSize(14);
设置后drawable图片没有绘制出来