(趣味)C++でやっています。
GDI+というライブラリを使ってjpgファイル内に記述されているタグデータを取得したいと考えています。
GDI+ではPropertyTagTypeByteという定数があり、
PropertyTagTypeASCII Specifies that the value data member is a null-terminated ASCII string. If you set the type data member of a PropertyItem object to PropertyTagTypeASCII, you should set the length data member to the length of the string including the NULL terminator. For example, the string "HELLO" would have a length of 6. PropertyTagTypeByte Specifies that the value data member is an array of bytes. PropertyTagTypeLong Specifies that the value data member is an array of unsigned long (32-bit) integers. PropertyTagTypeRational Specifies that the value data member is an array of pairs of unsigned long integers. Each pair represents a fraction; the first integer is the numerator and the second integer is the denominator. PropertyTagTypeShort Specifies that the value data member is an array of unsigned short (16-bit) integers. PropertyTagTypeSLONG Specifies that the value data member is an array of signed long (32-bit) integers. PropertyTagTypeSRational Specifies that the value data member is an array of pairs of signed long integers. Each pair represents a fraction; the first integer is the numerator and the second integer is the denominator. PropertyTagTypeUndefined Specifies that the value data member is an array of bytes that can hold values of any data type.
という定義のようです。
PropertyTagTypeASCIIは何とか理解できたのですが( wchar_t配列と考えていいみたいです。 )
それ以外の ~Byte, ~Long... がわかりません。
実際に試してみましたが、意味のあるデータだとは思えません...
~ASCII のやつなら取得できたデータを見ると "コメントです" のような意味のあるデータだったり、
日付とかでした。
これらならわかるのですが~Long等は数値なので、まったくイメージができません...
それぞれの読み方(?)をご存じの方、お願い致します。
例えば tag[].value にデータが入っているものとして
wchar_t w[261];
// for文内にて
wprintf( w, "%S", (wchar_t*)tag[i].value );
のようにすればいい...みたいな感じのです。
説明がしづらいのでわかりにくいとは思いますが...
「"GDI+" PropertyTagTypeByte」等で検索してみましたが、Delphiのものは見つかりましたが、C言語やC++でのものがなかったので...
[情報]
言語: C++
開発環境: VC++2008
[追記0~1]
すみません。外出先だったのでソースコードが開示できませんでした...
※1: 本来は分割してあり、ここに載せるためにちょっと修正してあります。なので欠けていたりnamespace名が違っていたりしますが...
※2: また、GDI+のヘルプファイルにあったサンプルを参考にしています。
[追記1.2]
あ、GDI+は最新のものだと思います。つい最近取ったので...
(バージョン忘れた...)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/07 01:49