harvic_blg_share's People
Forkers
liguobingh sbbqq rotate-fly dykdykdyk liuxuanhai bruceetao lixingzhou xcode126 higersister zr940326 zhenjun85 hanfruit jamgudev hawkflying k214k lxlpp123 smartcoded xiongxiangwei gandroidproject sxfxwlh noraff 907001710 jihuiquan tom1881 wanpenglin jianggeoo wr-android yueqingchan andrewtsezhou 806532727 w1984908499 zhangsan2016 yztcit 979451341 ws1009 cocowobo 18243013969 paioliu ztz12 jaychou super-crab ship155355 huy025 fredydeng leeeast crazycoderchao wangjianxiandev igeek365 fanzhangvip keeponzhang craz131415 zeng-ge cj252814053 omancs bravefaith gentleli jerry870101 toberole wjygg ablexq lu-java lgq1001 qtyearlin bufferh serge66 guiyanbing shenxiaolin jacky323 axter littleboybiggun offend sourceadflt michaelniu1990 corffen chenjianping99 rootjw nien690 2410489193 wlxing ruiqianqi xiexiupu kanshu1315 cinling118 tikook francked lbj38057473 huachao1001 002and001 ixinrun forksource niaojin xiangzhiwuhui vxinv alixiaopeng 18805699674 chongdy aqianchu smaboy yanpugithub hashwaneyharvic_blg_share's Issues
BitmapShader 填充顺序的问题
博客里面讲到先填充Y轴,然后填充X轴。但是,我按照先填充X轴,然后填充Y轴,也可以走通。
那么,博客里面讲到的先填充Y轴,然后再填充X轴,是出于理解需要,还是事实上就是如此呢?
。。。
。。。
MATRIX_SAVE_FLAG 不能保存位置矩阵的问题
看到书上第9章的 MATRIX_SAVE_FLAG
部分:
public class MATRIX_SAVE_FLAG_View2 extends View {
private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
public MATRIX_SAVE_FLAG_View2(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
paint.setColor(Color.GREEN);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 只可以保存 Canvas 的位置矩阵
canvas.save(Canvas.MATRIX_SAVE_FLAG);
// 不可以保存画布裁剪
canvas.clipRect(100, 0, 200, 100);
canvas.drawColor(Color.GREEN);
// 恢复画布
canvas.restore();
canvas.drawColor(Color.YELLOW);
}
}
运行在不同版本的手机上效果不一样:
在4.4和7.0上和书上讲的是一致的;
在6.0和8.0上确实整个屏幕都是黄色的。
也就是说,在6.0和8.0上,使用MATRIX_SAVE_FLAG
,按说应该会保留下来位置矩阵并还原位置矩阵,但是不会保留大小也谈不上还原大小。目前,却是把大小也还原了。
看到在api28已经把这个移除掉了,但是我这边使用的是27,应该不是这个原因吧?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.