总结:

各行各样都会淘汰一些能力差的,不仅仅是IT这个行业,所以,不要被程序猿是吃青春饭等等这类话题所吓倒,也不要觉得,找到一份工作,就享受安逸的生活,你在安逸的同时,别人正在奋力的向前跑,这样与别人的差距也就会越来越遥远,加油,希望,我们每一个人,成为更好的自己。

  • BAT大厂面试题、独家面试工具包,

  • 资料包括 数据结构、Kotlin、计算机网络、Framework源码、数据结构与算法、小程序、NDK、Flutter,


网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

android:background=“#98761f”

tools:context=“com.example.screenshoot.MainActivity” >

<TextView

android:id=“@+id/textView1”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“@string/hello_world” />

<Button

android:id=“@+id/bt1”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_alignParentLeft=“true”

android:text=“截屏技术1111”

android:layout_below=“@+id/textView1”

android:layout_marginTop=“16dp” />

<Button

android:id=“@+id/bt2”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_alignLeft=“@+id/bt”

android:layout_below=“@+id/bt1”

android:layout_marginTop=“30dp”

android:text=“截屏技术2222” />

<Button

android:id=“@+id/bt3”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_alignParentLeft=“true”

android:layout_below=“@+id/bt2”

android:layout_marginTop=“33dp”

android:text=“截屏技术3333” />

MainActivity.java

package com.example.screenshoot;

import java.io.File;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import android.app.Activity;

import android.content.Context;

import android.graphics.Bitmap;

import android.graphics.Bitmap.Config;

import android.graphics.Canvas;

import android.graphics.Rect;

import android.os.Bundle;

import android.os.Environment;

import android.util.Log;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

private Button bt1, bt2, bt3;

View rootView;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

bt1 = (Button) findViewById(R.id.bt1);

bt2 = (Button) findViewById(R.id.bt2);

bt3 = (Button) findViewById(R.id.bt3);

bt1.setOnClickListener(this);

bt2.setOnClickListener(this);

bt3.setOnClickListener(this);

rootView= findViewById(R.id.rootView);

}

@Override

public void onClick(View v) {

switch (v.getId()) {

case R.id.bt1:// View的getDrawingCache()方法

View view = this.getWindow().getDecorView();

//或者View view=v.getRootView();

view.setPressed(false);//这样就不会截取到button被按下的状态

view.setDrawingCacheEnabled(true);

view.buildDrawingCache();

Bitmap b1 = view.getDrawingCache();

// 获取状态栏高度

Rect frame = new Rect();

this.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);

int statusBarHeight = frame.top;

Log.i(“TAG”, “” + statusBarHeight);

// 获取屏幕长和高

int width = getResources().getDisplayMetrics().widthPixels;

int height =getResources().getDisplayMetrics().heightPixels;

// 去掉标题栏

// Bitmap b = Bitmap.createBitmap(b1, 0, 25, 320, 455);

Bitmap bitmap = Bitmap.createBitmap(b1, 0, statusBarHeight, width,

height - statusBarHeight);

saveMyBitmap(“noTitle”, bitmap);// 去掉标题栏的

saveMyBitmap(“hadTitle”, b1);

view.destroyDrawingCache();

break;

case R.id.bt2:

// TODO Auto-generated method stub

Bitmap newb = Bitmap.createBitmap(getResources().getDisplayMetrics().widthPixels, getResources().getDisplayMetrics().heightPixels, Config.ARGB_8888);

Canvas canvas = new Canvas(newb);

rootView.draw(canvas);

File file = new File(Environment.getExternalStorageDirectory()

  • “/” + “secondMethod.png”);

FileOutputStream f = null;

try {

f = new FileOutputStream(file);

} catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

boolean b = newb.compress(Bitmap.CompressFormat.PNG, 100, f);

try {

f.flush();

} catch (IOException e) {

e.printStackTrace();

}

try {

f.close();

} catch (IOException e) {

e.printStackTrace();

}

if (b) {

// 截图成功

Toast.makeText(this, “截图成功”, 1).show();

}

break;

case R.id.bt3:

saveMyBitmap(“thirdMethod”, getViewBitmap(v));;

break;

default:

break;

}

}

/**

最后送福利了,现在关注我可以获取包含源码解析,自定义View,动画实现,架构分享等。
内容难度适中,篇幅精炼,每天只需花上十几分钟阅读即可。
大家可以跟我一起探讨,有flutter—底层开发—性能优化—移动架构—资深UI工程师 —NDK相关专业人员和视频教学资料,还有更多面试题等你来拿

录播视频图.png

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

—移动架构—资深UI工程师 —NDK相关专业人员和视频教学资料,还有更多面试题等你来拿**

[外链图片转存中…(img-9ixPD33Y-1714815614416)]

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐