![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | Re: png metadata The PNG text chunk is "tEXt" not "tEXT" Glenn |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Who keep metadata from XP ? | Max | Vista file management | 10 | 02-13-2008 05:22 PM |
| WSD and Metadata using SSL | Sohan | Vista security | 0 | 11-14-2006 09:48 AM |
| metadata standards | =?Utf-8?B?U2FtdWVs?= | Vista General | 3 | 08-21-2006 02:48 PM |
| metadata | =?Utf-8?B?U2FtdWVs?= | Vista General | 5 | 07-20-2006 10:06 AM |
| metadata | =?Utf-8?B?U2FtdWVs?= | Vista General | 1 | 07-19-2006 01:55 PM |