Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 823fe40

Browse files
no message
1 parent 8fbe49b commit 823fe40

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

‎README.md‎

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### 跟miui一样的自动滚动截屏
22

3-
>> 很久之前写过一篇长截屏的博客,不过很仓促,现在重新整理一下,绝对是你从没见过的长截屏方式 [android长截屏beta1](http://blog.csdn.net/qingchunweiliang/article/details/52248643)
3+
>> 很久之前写过一篇完全不同于其他长截屏方案的的博客,不过很仓促,现在重新整理一下 [android长截屏beta1](http://blog.csdn.net/qingchunweiliang/article/details/52248643)
44
55

66
####
@@ -9,7 +9,7 @@
99
* 手动调用`FrameLayout``draw`方法把`view`画到`bitmap`
1010

1111
```java
12-
Bitmap bitmap = Bitmap.createBitmap(container.getWidth(), container.getHeight(), Bitmap.Config.ARGB_8888);
12+
Bitmap bitmap = Bitmap.createBitmap(container.getWidth(), container.getHeight(), Bitmap.Config.ARGB_8888);
1313
Canvas canvas = new Canvas(bitmap);
1414
container.draw(canvas);
1515

@@ -169,7 +169,8 @@ container.draw(canvas);
169169
for (Bitmap bitmap : bitmaps) {
170170
h += bitmap.getHeight();
171171
}
172-
Bitmap bitmap = Bitmap.createBitmap(container.getWidth(), h, Bitmap.Config.RGB_565);
172+
//如果你需要透明度或者对图片质量要求很高的话请使用Config.ARGB_8888
173+
Bitmap bitmap = Bitmap.createBitmap(container.getWidth(), h, Bitmap.Config.RGB_565);
173174
Canvas canvas = new Canvas(bitmap);
174175
for (Bitmap b : bitmaps) {
175176
canvas.drawBitmap(b, 0, 0, null);
@@ -200,9 +201,37 @@ container.draw(canvas);
200201
```
201202
#### 最终效果
202203

203-
左边是自动滚动的Listview,右边是停止截屏后的bitmap
204+
左边是自动滚动的Listview,右边是停止截屏后的bitmap,可以看到完全没有拼接痕迹
205+
206+
204207
![效果](https://github.com/android-notes/auto-scroll-capture/blob/master/auto_cap_demo.gif?raw=true)
205208

206209

207210

211+
212+
```txt
213+
MIT License
214+
215+
Copyright (c) 2018 wanjian
216+
217+
Permission is hereby granted, free of charge, to any person obtaining a copy
218+
of this software and associated documentation files (the "Software"), to deal
219+
in the Software without restriction, including without limitation the rights
220+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
221+
copies of the Software, and to permit persons to whom the Software is
222+
furnished to do so, subject to the following conditions:
223+
224+
The above copyright notice and this permission notice shall be included in all
225+
copies or substantial portions of the Software.
226+
227+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
228+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
229+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
230+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
231+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
232+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
233+
SOFTWARE.
234+
235+
236+
```
208237

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /