![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
个人笔记 C#
Acme_Thanatos
这个作者很懒,什么都没留下…
展开
-
创建填充色背景图
int nWidth = 300 , nHeight =300;Bitmap bmp = new Bitmap(nWidth, nHeight);Graphics g = Graphics.FromImage(bmp);SolidBrush b = new SolidBrush(Color.Red);g.FillRectangle(b, 0, 0, nWidth, nHeight)原创 2016-11-18 10:54:45 · 238 阅读 · 0 评论 -
结构体转换byte数组
/// <summary>/// 单个结构体转换byte数组/// </summary>/// <param name="structObj">结构体对象</param>/// <returns></returns>public static byte[] StructToBytes(object structObj){ //得到结构体的大小 int size = Marsh原创 2016-11-18 11:19:50 · 1721 阅读 · 0 评论 -
Byte 一维数组 和 二维数组 互换
public static byte[] ByteArrToByte(Byte[,] b, int nNum1, int nNum2) { List<byte> list = new List<byte>(); for (int i = 0; i < nNum1; i++) { for (int j = 0; j < nNum2; j++)原创 2016-11-18 11:41:16 · 2247 阅读 · 0 评论 -
时间,时间戳转换
/// /// 时间戳Timestamp /// /// public static int GetCurrentTime(){DateTime DateStart = new DateTime(1970, 1, 1, 0, 0, 0);return Convert.ToInt32((DateTime.Now -DateStart).TotalSeconds);}原创 2016-11-18 10:40:13 · 232 阅读 · 0 评论