Click here to Skip to main content
15,894,896 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: ScrollViewer - How To Determine End of Scroll Pin
Pete O'Hanlon22-May-09 0:52
mvePete O'Hanlon22-May-09 0:52 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP22-May-09 8:54
mve#realJSOP22-May-09 8:54 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP1-Jun-09 11:09
mve#realJSOP1-Jun-09 11:09 
QuestionNo get device context Pin
krishnan.s20-May-09 15:26
krishnan.s20-May-09 15:26 
AnswerRe: No get device context Pin
Mark Salsbery20-May-09 15:49
Mark Salsbery20-May-09 15:49 
GeneralRe: No get device context Pin
krishnan.s21-May-09 0:22
krishnan.s21-May-09 0:22 
GeneralRe: No get device context Pin
Mark Salsbery21-May-09 5:45
Mark Salsbery21-May-09 5:45 
QuestionGettting metadata from TIFF file fails Pin
fjparisIII20-May-09 12:09
fjparisIII20-May-09 12:09 
I'm using BitmapMetadata.GetQuery() to get metadata from JPEG files just fine with queries like the following, for example, to get the creation date: "/app1/ifd/exif/subifd:{uint=36867}". But when I use the same query string with a .TIFF file, I get nothing back. Every query I make on the TIFF file fails.

I know the TIFF file has the metadata in it I'm seeking because I can see it through the Windows Explorer when I hover over the file name. Here is the code I'm using to read the metadata and the debugger shows me that the BitmapSource I get back from the TIFF file has metadata in it, but the GetQuery() returns null. Should the query string somehow be different for the two formats? Any ideas?

BitmapMetadata metaInfo;
Stream imageStream = null;
imageStream = new FileStream(imageUri.LocalPath, FileMode.Open,
                          FileAccess.Read, FileShare.ReadWrite);
string extension = System.IO.Path.GetExtension(imageUri.LocalPath);
BitmapSource bitmapSource = null;
switch (extension.ToLower())
{
    case ".jpg":
        JpegBitmapDecoder decoderJpg =
            new JpegBitmapDecoder(imageStream,
                                  BitmapCreateOptions.PreservePixelFormat,
                                  BitmapCacheOption.Default);
        bitmapSource = decoderJpg.Frames[0];
        break;

    case ".tif":
        TiffBitmapDecoder decoderTif =
            new TiffBitmapDecoder(imageStream,
                                  BitmapCreateOptions.PreservePixelFormat,
                                  BitmapCacheOption.Default);
        bitmapSource = decoderTif.Frames[0];
        break;

    default:
        break;
}

// This returns a valid BitmapMetadata reference from both decoders.
metaInfo = (BitmapMetadata)bitmapSource.Metadata;
if (metaInfo != null)
{
    if (metaInfo.ContainsQuery("/app1/ifd/exif/subifd:{uint=36867}"))
        // JPEG goes down this path.
        return metaInfo.GetQuery("/app1/ifd/exif/subifd:{uint=36867}");  
    else
        // TIFF goes down this path.
        return null;
}
else
{
    return null;
}

AnswerRe: Gettting metadata from TIFF file fails Pin
Mark Salsbery20-May-09 15:45
Mark Salsbery20-May-09 15:45 
GeneralRe: Gettting metadata from TIFF file fails (RESOLVED!) Pin
fjparisIII20-May-09 16:46
fjparisIII20-May-09 16:46 
GeneralRe: Gettting metadata from TIFF file fails (RESOLVED!) Pin
Mark Salsbery20-May-09 17:15
Mark Salsbery20-May-09 17:15 
GeneralRe: Gettting metadata from TIFF file fails (RESOLVED!) Pin
fjparisIII21-May-09 12:33
fjparisIII21-May-09 12:33 
QuestionMessage Removed Pin
20-May-09 4:15
professionalN_tro_P20-May-09 4:15 
AnswerMessage Removed Pin
20-May-09 8:00
professionalN_tro_P20-May-09 8:00 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
#realJSOP20-May-09 8:11
mve#realJSOP20-May-09 8:11 
GeneralMessage Removed Pin
20-May-09 8:18
professionalN_tro_P20-May-09 8:18 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery20-May-09 10:35
Mark Salsbery20-May-09 10:35 
GeneralMessage Removed Pin
21-May-09 3:17
professionalN_tro_P21-May-09 3:17 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery21-May-09 6:55
Mark Salsbery21-May-09 6:55 
GeneralMessage Removed Pin
21-May-09 7:49
professionalN_tro_P21-May-09 7:49 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery21-May-09 8:01
Mark Salsbery21-May-09 8:01 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery21-May-09 8:08
Mark Salsbery21-May-09 8:08 
GeneralMessage Removed Pin
21-May-09 8:19
professionalN_tro_P21-May-09 8:19 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery21-May-09 8:21
Mark Salsbery21-May-09 8:21 
AnswerRe: Remove Selection of Listbox Inside of a Template Pin
Niladri_Biswas13-Jun-09 3:27
Niladri_Biswas13-Jun-09 3:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.