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

CropFilter裁剪不准确 #54

Open
busymilk opened this issue Dec 20, 2018 · 3 comments
Open

CropFilter裁剪不准确 #54

busymilk opened this issue Dec 20, 2018 · 3 comments

Comments

@busymilk
Copy link

canvas.save();
canvas.translate(0,currentY);
........
.......
canvas.drawBitmap(currentDrawInfo.pageBitmap, 0, 0, new CropFilter(0, 0, 1f, 0.5f));
canvas.restore();
你好,我在调用这个绘制一个图片时,图片显示的,总是超过图片总高度的一半,是我哪里用错了么?

这种方式没法裁剪,我用了另一种方式:先绘制整张图片,然后从图片的1/2处开始绘制rect fill color,
但是color我指定非透明色,可以绘制,但是绘制透明色,则图片下半部分没有被盖住,请问该调用哪个api呢?谢谢啦

@ChillingVan
Copy link
Owner

能上效果吗?我试了下,没发现问题呀
canvas.save(); canvas.translate(0, 119); canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.lenna), 0, 0, new CropFilter(0,0,1,0.5f)); canvas.restore();

@PopMain
Copy link

PopMain commented Aug 6, 2023

我这里也遇到了这个问题
image
第一行是用cropfilter(0f,0f,0.5f,1f)的效果,第二行是用Bitmap.createBitmap裁剪一半的效果

@ChillingVan
Copy link
Owner

我这里也遇到了这个问题 image 第一行是用cropfilter(0f,0f,0.5f,1f)的效果,第二行是用Bitmap.createBitmap裁剪一半的效果

@PopMain 你好,请问可以贴一下源代码或者demo吗?

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

3 participants