Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kangshifu opened this issue Jan 17, 2020 · 1 comment

Comments

@kangshifu
Copy link

No description provided.

@kangshifu
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant