huangyz0918 / AndroidWM

An android image watermark library that supports steganography.
http://huangyz.name/AndroidWM/
Apache License 2.0
1.59k stars 202 forks source link

我想设置下水印是文字加logo的支持吗,然后每个水印之间需要加上下左右的margin,可以升个版本支持下不 #39

Open kangshifu opened 4 years ago

kangshifu commented 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图片没有绘制出来