I would like to give my Bitmap a PropertyItem value but i am not really sure how to give it a System::String^ value.
System::Drawing::Imaging::PropertyItem^ propItem = gcnew System::Drawing::Imaging::PropertyItem;
System::String^ newValue = gcnew System::String("newValue");
propItem->Id = PropertyTagImageTitle;
propItem->Len = 9;
propItem->Type = PropertyTagTypeASCII;
propItem->Value = newValue;
bmp->SetPropertyItem(propItem);
"System::Drawing::Imaging::PropertyItem::Value::set" cannot be called with the given argument list." Argument types are(System::String^) Object type is System::Drawing::Imaging::PropertyItem^
Hans Passant's answer is correct. I've implemented it like followed:
System::Drawing::Image^ theImage = System::Drawing::Image::FromFile("C:\\image.png");
System::Text::Encoding^ utf8 = System::Text::Encoding::UTF8;
array<System::Drawing::Imaging::PropertyItem^>^ propItem = theImage->PropertyItems;
System::String^ newValue = gcnew System::String("newValue");
propItem->Id = PropertyTagImageTitle;
propItem[0]->Len = 18;
propItem->Type = PropertyTagTypeByte;
array<Char>^propItemValue = newValue->ToCharArray();
array<byte>^ utf8Bytes = utf8->GetBytes(propItemValue);
propItem[0]->Value = utf8Bytes;
theImage->SetPropertyItem(propItem[0]);