- 博客(5)
- 资源 (7)
- 收藏
- 关注
原创 C语言画Bezier曲线插值算法
在UI开发中,常常需要将一组数据点连成线,以展示数据变化趋势。为了设计美观且符合直觉,就需要拟合一条光滑的曲线通过所有的数据点,而不是生硬的点对点直线连接。这时候就要用到Bezier曲线插值算法来实现。
2024-08-20 15:29:33
601
原创 MediaPlayer + SurfaceView播放视频时,保持视频原始比例的方法。
public static Size getOptimalDisplaySize(Context context, int videoWidth, int videoHeight) { int orientation = context.getResources().getConfiguration().orientation; int screenWidth = context.getResources().getDisplayMetrics().widthPixels; int.
2020-08-14 15:49:38
952
原创 Android 不规则图形布局的一种实现方法
1. 自定义布局:public class ImageClip extends FrameLayout { private int width = -1; private int height = -1; private Bitmap bitmap; public ImageClip(Context context) { super(cont...
2019-10-11 18:34:11
778
原创 socket通信
socket server:int main(int argc, char* argv[]) { int sockfd, connfd; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0){ perror("socket create error!"); exit(-1);...
2019-09-18 10:15:58
283
原创 Android 蓝牙连接
定义广播:private BroadcastReceiver bluetoothReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); ...
2019-09-17 19:07:51
307
51单片机红外编码解码模拟仿真
2010-03-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅