Loading a image and copying the metadata of a jpeg image.

Posted by Ravi shankar on Stack Overflow See other posts from Stack Overflow or by Ravi shankar
Published on 2010-05-01T16:27:54Z Indexed on 2010/05/01 16:37 UTC
Read the original article Hit count: 498

Filed under:

I am trying to load a jpeg image and trying to copy metadata to new image, but the new image is created with out any metadata. Can some one help me out in solving above problem. I am using C++ CLI 3.5.

if (System::IO::Stream ^jpegStreamIn = File::Open(FileMyPictures, FileMode::Open, FileAccess::ReadWrite, FileShare::None))
{
  decoder = gcnew System::Windows::Media::Imaging::JpegBitmapDecoder(jpegStreamIn,     
  System::Windows::Media::Imaging::BitmapCreateOptions::PreservePixelFormat, 
  System::Windows::Media::Imaging::BitmapCacheOption::OnLoad);
  jpegStreamIn->Close();
}

bitmapFrame = decoder->Frames[0];
metadata = (System::Windows::Media::Imaging::BitmapMetadata^)bitmapFrame->Metadata;

© Stack Overflow or respective owner

Related posts about c++-cli