照片元数据信息以及在照片中写入gps信息
| Integer | 表示的类型 |
|---|---|
| 1 | 指定 Value 为字节数组。 |
| 2 | 指定 Value 为空终止 ASCII 字符串。如果将类型数据成员设置为 ASCII 类型,则应该将 Len 属性设置为包括空终止的字符串长度。例如,字符串“Hello”的长度为 6。 |
| 3 | 指定 Value 为无符号的短(16 位)整型数组。 |
| 4 | 指定 Value 为无符号的长(32 位)整型数组。 |
| 5 | 指定 Value 数据成员为无符号的长整型对数组。每一对都表示一个分数;第一个整数是分子,第二个整数是分母。 |
| 6 | 指定 Value 为可以包含任何数据类型的值的字节数组。 |
| 7 | 指定 Value 为有符号的长(32 位)整型数组。 |
| 10 | 指定 Value 为有符号的长整型对数组。每一对都表示一个分数;第一个整数是分子,第二个整数是分母。 |
/// PropertyTagGpsLatitudeRef
SetPropertyString(bitmap, 0x0001, "N");
/// PropertyTagGpsLongitudeRef
SetPropertyString(bitmap, 0x0003, "E");
byte[] bytes = new byte[];
byte[] bytes1 = BitConverter.GetBytes();
byte[] bytes2 = BitConverter.GetBytes();
byte[] bytes3 = BitConverter.GetBytes();
byte[] bytes4 = BitConverter.GetBytes();
byte[] bytes5 = BitConverter.GetBytes();
byte[] bytes6 = BitConverter.GetBytes();
int index = ;
bytes1.CopyTo(bytes, index);
index += ;
bytes2.CopyTo(bytes, index);
index += ;
bytes3.CopyTo(bytes, index);
index += ;
bytes4.CopyTo(bytes, index);
index += ;
bytes5.CopyTo(bytes, index);
index += ;
bytes6.CopyTo(bytes, index); /// PropertyTagGpsLatitude
SetProperty(bitmap, 0x0002, bytes, ); bytes = new byte[];
bytes1 = BitConverter.GetBytes();
bytes2 = BitConverter.GetBytes();
bytes3 = BitConverter.GetBytes();
bytes4 = BitConverter.GetBytes();
bytes5 = BitConverter.GetBytes();
bytes6 = BitConverter.GetBytes();
index = ;
bytes1.CopyTo(bytes, index);
index += ;
bytes2.CopyTo(bytes, index);
index += ;
bytes3.CopyTo(bytes, index);
index += ;
bytes4.CopyTo(bytes, index);
index += ;
bytes5.CopyTo(bytes, index);
index += ;
bytes6.CopyTo(bytes, index); /// PropertyTagGpsLongitude
SetProperty(bitmap, 0x0004, bytes, );
public void SetProperty(Bitmap image, Int32 propertyItemId, byte[] bytes, short propertyItemType)
{
System.Drawing.Imaging.PropertyItem propertyItem = (System.Drawing.Imaging.PropertyItem)(System.Activator.CreateInstance(typeof(System.Drawing.Imaging.PropertyItem), true));
propertyItem.Id = propertyItemId;
propertyItem.Value = bytes;
propertyItem.Type = propertyItemType;
propertyItem.Len = bytes.Length;
image.SetPropertyItem(propertyItem);
}
照片元数据信息以及在照片中写入gps信息的更多相关文章
- java Exception 出错的栈信息打印到日志中 打印堆栈信息
我们在开发程序的过程当中,日志是必不可少的工具,这有助于我们分析问题的原因,和出错的详细信息,而java的异常机制又会方便且迅速的帮我们找到出错行的位置. try { .... } catch (Ex ...
- 巧用section在cshtml写入layout中写入head信息 ASP.NET MVC
转自:http://www.cnblogs.com/a-xu/archive/2012/05/08/2489746.html layout文件中: <head> <meta char ...
- Android 之 PackageManager获取的应用程序信息与AndroidManifest文件中设置的信息不一致问题
有时我们需要用 PackageManager 来获取应用程序的版本号和版本名称等信息,通过以下代码来获取: PackageManager manager = getPackageManager(); ...
- 利用图片中的exif元数据批量查找图片中所包含的GPS信息
在图片的exif(交换图像文件格式)中标准定义了如何存储图像和音频文件的标准,而在这些标签中往往存在了一些容易被人们忽视却又重要的东西. 有一款工具名为exiftool,可以快速的解析所有标签,并将结 ...
- java往文本文件中写入信息并修改
题目要求: 1.可以往一个文本文档中写入员工信息:name,id和详情 2.可以更改name package FanCQ.Xue.practice; import java.io.*;import j ...
- PowerShell_零基础自学课程_6_PS中获取帮助信息详解、管道、格式化输
前些文章陆续的说了一些关于这些主题,但是讨论的都不够深入,今天我们深入的了解一下获取帮助信息.管道以及格式化输出的内容. 一.获取帮助信息 在PS中获取帮助信息,最常用的有: -? .get-comm ...
- ETL应用:使用Pro*C写入文件信息入库的方法
ETL处理过程中,经常需要进行文件校验,如文件级校验.记录级校验,需要保存文件的基本信息,文件名.文件大小.数据日期等,使用Pro*C的一种方法如下: #include <stdio.h> ...
- 使用 python 提取照片中的手机信息
使用 python 提取照片中的手机信息 最近在做一个项目,有一个很重要的点是需要获取使用用户的手机信息,这里我选择从照片中获取信息.有人会问为什么不从手机里面直接获取设备信息.由于现在android ...
- 选择本地照片之后即显示在Img中(客户体验)
最近转战MVC项目,然后又再次遇到照片上传的实现,之前都是使用ASP.NET,虽然也有照片上传,而且出于客户体验考虑, 也实现了选择本地照片之后即时显示在IMG中,在这里就简单介绍其实现(ASP.NE ...
随机推荐
- [zz]简单有效,在家就能锻炼!
简单有效,在家就能锻炼!下面这套动作美腿.美臀.瘦腰,一步到位,是全身塑形的必备,不用多练,每组1分钟.只需一把椅子即可,献给没有时间.条件去健身房的健身爱好者们! http://weibo.com/ ...
- SOAOffice和iWebOffice、NTKO的比较及其优势(转)
http://www.cnblogs.com/liping13599168/articles/1681465.html SOAOffice和iWebOffice.NTKO的比较及其优势 近年来,市场上 ...
- jQuery源码:从原理到实战
jQuery源码:从原理到实战 jQuery选择器对象 $(".my-class"); document.querySelectorAll*".my-class" ...
- (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about t
运行redis过程中,突然报错如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not a ...
- java对xml文件的读取
<?xml version="1.0" encoding="UTF-8"?> <body> <names type="1 ...
- Visual Studio 在调试时启用编辑功能
Visual Studio边调试边修改 如果你在调试一个web应用程序的时候,想进行编辑,可以有如下两种方法: 方法一:在web项目的属性页里的web标签页,选中"启用编辑并继续&qu ...
- CentOS下安装LAMP环境
1.安装Apache yum -y install httpd # 开机自启动 chkconfig httpd on # 启动httpd 服务 service httpd start #安装apach ...
- Java中遍历Map集合的四种方法
在Java中如何遍历Map对象 How to Iterate Over a Map in Java 在java中遍历Map有不少的方法.我们看一下最常用的方法及其优缺点. 既然java中的所有map都 ...
- sqlServer 2008修改字段类型和重命名字段名称的sql语句
sqlServer 2008修改字段类型和重命名字段名称的sql语句 //修改字段的类型 alter table fdi_news alter column c_author nvarchar(50) ...
- Tab切换
代码 <!DOCTYPE html> <html lang="en"><head> <meta charset="UTF-8&q ...