Click here to Skip to main content
15,916,432 members
Home / Discussions / WPF
   

WPF

 
Questionprogramming html in wpf using c# Pin
ramakrishnamakkena21-May-09 2:40
ramakrishnamakkena21-May-09 2:40 
AnswerRe: programming html in wpf using c# Pin
Pete O'Hanlon21-May-09 4:32
mvePete O'Hanlon21-May-09 4:32 
QuestionListViewItem promblem Pin
mildred-frontfree21-May-09 0:57
mildred-frontfree21-May-09 0:57 
AnswerRe: ListViewItem promblem Pin
ABitSmart21-May-09 5:13
ABitSmart21-May-09 5:13 
GeneralRe: ListViewItem promblem Pin
mildred-frontfree21-May-09 18:14
mildred-frontfree21-May-09 18:14 
GeneralRe: ListViewItem promblem Pin
ABitSmart21-May-09 18:26
ABitSmart21-May-09 18:26 
AnswerRe: ListViewItem promblem Pin
Niladri_Biswas13-Jun-09 3:17
Niladri_Biswas13-Jun-09 3:17 
GeneralRe: ListViewItem promblem Pin
mildred-frontfree16-Jun-09 14:56
mildred-frontfree16-Jun-09 14:56 
GeneralRe: ListViewItem promblem Pin
Niladri_Biswas17-Jun-09 21:13
Niladri_Biswas17-Jun-09 21:13 
QuestionHelp getting values from combobox and comparing them to items in stackpanel Pin
Member 422055221-May-09 0:45
Member 422055221-May-09 0:45 
QuestionScrollViewer - How To Determine End of Scroll [SOLVED] Pin
#realJSOP21-May-09 0:32
professional#realJSOP21-May-09 0:32 
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
professional#realJSOP22-May-09 8:54 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP1-Jun-09 11:09
professional#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 

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.