/// <summary> /// unsigned long の値を設定する。 /// </summary> /// <param name="id"></param> /// <param name="value"></param> /// <returns></returns> public ImagePropertyItemWriter SetPropertyItem(PropertyTags id, uint value) { byte[] bytes = new byte[sizeof(ulong)]; for (int i = 0; i < sizeof(ulong); i++) { bytes[i] = (byte)((value >> (i * 8)) & 0xff); } SetPropertyItem(id, PropertyTagType.PropertyTagTypeLong, bytes.Length, bytes); return(this); }
/// <summary> /// 指定したIDのPropertyItemを得る。 /// </summary> /// <param name="id"></param> /// <returns></returns> public PropertyItem GetPropertyItemById(PropertyTags id) { PropertyItem propertyItem = null; if (propertyDictionaryById.TryGetValue((int)id, out propertyItem)) { return(propertyItem); } return(null); }
/// <summary> /// プロパティを設定する。 /// </summary> /// <param name="id"></param> /// <param name="type"></param> /// <param name="len"></param> /// <param name="value"></param> /// <returns></returns> private ImagePropertyItemWriter SetPropertyItem( PropertyTags id, PropertyTagType type, int len, byte[] value) { propSeed.Id = (int)id; propSeed.Type = (short)type; propSeed.Len = len; propSeed.Value = value; LogPropertyItem("[PropertyItemAdder.SetPropertyItem] ", propSeed); image.SetPropertyItem(propSeed); return(this); }
/// <summary> /// byte値のプロパティを設定する。 /// </summary> /// <param name="id"></param> /// <param name="value"></param> /// <returns></returns> public ImagePropertyItemWriter SetPropertyItem(PropertyTags id, byte value) { byte[] bytes = new byte[] { value }; SetPropertyItem(id, PropertyTagType.PropertyTagTypeByte, bytes.Length, bytes); return(this); }
/// <summary> /// 文字列のプロパティを設定する。 /// </summary> /// <param name="id"></param> /// <param name="value"></param> /// <returns></returns> public ImagePropertyItemWriter SetPropertyItem(PropertyTags id, string value) { byte[] bytes = ImagePropertyItemWriter.StringToByteArray(value); SetPropertyItem(id, PropertyTagType.PropertyTagTypeASCII, bytes.Length, bytes); return(this); }