待转内容:
000000000000000000000000000000000000000000000000000000000000000000000000000000000001010202020304050607090B0E1114191E252D353F4B576472808E9BA8B4BFC8D0D4D8D9D7D4D0CBC5BFB9B0A89F968E878079736D67625D5A575552504E4C4A484644423F3D3A38363433312F2D2C2A28262422211F1E1D1C1B1A1919181716161514131211100F0E0D0D0D0D0C0C0C0B0B0A09090808070706060707070606060505050404040404040404040303030303030302020202020202020202020202010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000
16进制转10进制
var NEWBE = new byte[imageData.Length/2];
for (int i = 0; i < imageData.Length/2; i++)
string djsak = imageData.Substring(i * 2);
NEWBE[i] = byte.Parse(imageData.Substring(i*2,2), System.Globalization.NumberStyles.AllowHexSpecifier);
//画图初始化
Bitmap bMap = new Bitmap(500, 500);
Graphics gph = Graphics.FromImage(bMap);
gph.Clear(Color.White);
PointF cPt = new PointF(40, 420);
PointF[] xPt = new PointF[3]{
new PointF(cPt.Y+15,cPt.Y),
new PointF(cPt.Y,cPt.Y-8),
new PointF(cPt.Y,cPt.Y+8)};
PointF[] yPt = new PointF[3]{
new PointF(cPt.X,cPt.X-15),
new PointF(cPt.X+8,cPt.X),
new PointF(cPt.X-8,cPt.X)};
gph.DrawLine(Pens.Black, cPt.X, cPt.Y, cPt.Y, cPt.Y);
gph.DrawPolygon(Pens.Black, xPt);
gph.FillPolygon(new SolidBrush(Color.Black), xPt);
gph.DrawLine(Pens.Black, cPt.X, cPt.Y, cPt.X, cPt.X);
gph.DrawPolygon(Pens.Black, yPt);
gph.FillPolygon(new SolidBrush(Color.Black), yPt);
Point[] pis = new Point[NEWBE.Length];
for (int i = 1; i <= NEWBE.Length; i++)
if (i < 8)
gph.DrawString((i * 50).ToString(), new Font("宋体", 11), Brushes.Black,
new PointF(cPt.X + i * 50, cPt.Y));
gph.DrawLine(Pens.Black, cPt.X + i * 50, cPt.Y+3, cPt.X + i * 50, cPt.Y);
//画折线
if (i > 1)
gph.DrawLine(Pens.Red, cPt.X + ((i - 1)) , cPt.Y - d[i - 2] , cPt.X + i , cPt.Y - d[i - 1] );
//保存输出图片
bMap.Save("D:\\testS.bmp");
由于最近需要用SD卡记录摄像头拍的图像,记录的文件格式十六进制的(例如:0xf0就是对应图像中的八个像素点)需要做一个SD卡上位机来将十六进制文件转换成JPG图像格式,方便对图像的分析。
总体的思路是这样的
1.创建文件流,打开十六进制的文件
2.讲十六进制文件数据存放在一个数组中
3.读取数据,寻找事先设定的通讯协议(0x00,0xff,0x01,0x00)...
项目地址:https://gitcode.com/open-source-toolkit/809bf
Hex-to-JPG 是一个实用的工具,用于将单片机取模后的十六进制数据转换为图片格式。这个工具对于需要将十六进制数据可视化的开发者来说非常有用,尤其是在嵌入式系统和硬件开发领域。
十六进制转图片:将单片机取模后的十六进制数...
下面很长的东西为一张图片的16进制转码
@RequestMapping(value = LIST + "/testImg",method=RequestMethod.POST)
@ResponseBody
public String testImg(String imgByte){
String path = "D://imgSave";
File dir = new File(path
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;import javax.imageio.ImageIO;
import javax.i
VS RDLC使用
TCMY:
工作2周年心得
边境正在努力的程序员: