Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

png metadata

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-28-2006   #1 (permalink)
StefanT
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 SpecsSystem Spec
Old 02-28-2006   #2 (permalink)
robertwl@nospam.microsoft.com
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 SpecsSystem Spec
Old 03-01-2006   #3 (permalink)
StefanT
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 SpecsSystem Spec
Old 03-02-2006   #4 (permalink)
glennrp@gmail.com
Guest


 

Re: png metadata

The PNG text chunk is "tEXt" not "tEXT"

Glenn

My System SpecsSystem Spec
Closed Thread

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


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51