![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | png metadata Hi guys, I want to use the png tEXT metadata, can some help with some code sample of some link to web resources about this topic. Best regards, Stefan |
My System Specs![]() |
| | #2 (permalink) |
| | re: png metadata Hi Stefan, The query string to get to Png Metadata (tEXT) is: “/text/comment”. You can replace “comment” with any of the tEXT fields, like Author or Keywords. From a PngBitmapDecoder or from a BitmapFrame, try this: System.Windows.Media.Imaging.BitmapMetadata metadata = decoder.Metadata; if ( metadata != null ) { foreach ( string query in metadata ) { object o = metadata.GetQuery ( query ); } } Alternatively if you know what metadata you’re looking for, you can look for it using .GetQuery(“/text/comment”) [for example]. In order to set Metadata on the BitmapFrame, use the .SetQuery(…) method. Thanks, Robert. -----Original Message----- From: stefan_tabaranu Posted At: Monday, February 27, 2006 10:36 PM Posted To: microsoft.public.windows.developer.winfx.avalon Conversation: png metadata Subject: png metadata Hi guys, I want to use the png tEXT metadata, can some help with some code sample of some link to web resources about this topic. Best regards, Stefan |
My System Specs![]() |
| | #3 (permalink) |
| | re: png metadata Hi Robert, Thx a lot for your response, I try to render some simple text on an image like this: RenderTargetBitmap rtb = new RenderTargetBitmap(500, 500, 30, 30, PixelFormats.Pbgra32); DrawingVisual dv = new DrawingVisual(); DrawingContext dc = dv.RenderOpen(); dc.DrawText( new FormattedText("Test .... drawing some text", CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, new Typeface("Verdana"), 36, Brushes.Black), new Point(200, 116)); dc.Close(); rtb.Render(dv); PngBitmapEncoder png = new PngBitmapEncoder(); png.Metadata = new BitmapMetadata("/tEXT/"); //error - Property could not be found png.Frames.Add(BitmapFrame.Create(rtb)); using (Stream stm = File.Create("c:/foo.png")) { png.Save(stm); } When I try to create a new instance of the metadata object I get an error message "Property could not be found". I make something wrong ? I have a Beta 1 version of winfx sdk, shall I try with another version ? Best regards, Stefan "robertwl@nospam.microsoft.com" wrote: > Hi Stefan, > > The query string to get to Png Metadata (tEXT) is: “/text/comment”. You can replace “comment” with any of the tEXT fields, like Author or Keywords. > > From a PngBitmapDecoder or from a BitmapFrame, try this: > > System.Windows.Media.Imaging.BitmapMetadata metadata = decoder.Metadata; > > if ( metadata != null ) > { > foreach ( string query in metadata ) > { > object o = metadata.GetQuery ( query ); > } > } > > Alternatively if you know what metadata you’re looking for, you can look for it using .GetQuery(“/text/comment”) [for example]. In order to set Metadata on the BitmapFrame, use the .SetQuery(…) method. > > Thanks, > > Robert. > > -----Original Message----- > From: stefan_tabaranu > Posted At: Monday, February 27, 2006 10:36 PM > Posted To: microsoft.public.windows.developer.winfx.avalon > Conversation: png metadata > Subject: png metadata > > > Hi guys, > > I want to use the png tEXT metadata, can some help with some code sample > of some link to web resources about this topic. > > > > Best regards, > Stefan > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: png metadata The PNG text chunk is "tEXt" not "tEXT" Glenn |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Who keep metadata from XP ? | Vista file management | |||
| WSD and Metadata using SSL | Vista security | |||
| metadata | Vista General | |||
| metadata | Vista General | |||