|
|
Hi -
I'm trying to query for ink in a certain region of a page within OneNote. My query works ok, and I end up iterating through InkWords, gathering ink as I go. My strategy was to build a primary Ink object, adding ink from each InkWord to it as I go. Some pseudocode:
XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns); Ink ink = new Ink(); foreach(XmlNode node in dataNodes) { string encodedInk = node.InnerText; Ink tempInk = DecodeInk(encodedInk); primaryInk.AddStrokesAtRectangle(s, r); }
Within Decode Ink, I do the following:
Ink ink = new Ink(); ink.Load(Convert.FromBase64String(encodedInk)); return ink;
The problem is this: When I call Ink.Load, the ink object throws an exception:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
As far as I know, this only happens when the ink is in a format which the Ink object does not understand. I tried changing my ink.Load call to ink.Load("base64:" + Convert.FromBase64String(encodedInk)); ....but got the same result.
Is the Ink for an InkDrawing encoded differently after IA (conversion to InkWord)? I noticed a difference in the data, but assumed it was normalizing strokes or something, no re-encoding data. Thanks for any help!
Ben
|
|
Does this happen for all InkWords, or just some of them? Could you post the ISF for some of the ink that fails to load? Also, what version of the framework are you using?
Ilya
|
|
Yes please send us the ISF...I will work with you offline.
<benmca[ at ]gmail.com> wrote in message news:1182357744.190740.227640[ at ]o11g2000prd.googlegroups.com...
[Quoted Text] > Hi - > > I'm trying to query for ink in a certain region of a page within > OneNote. My query works ok, and I end up iterating through InkWords, > gathering ink as I go. My strategy was to build a primary Ink object, > adding ink from each InkWord to it as I go. Some pseudocode: > > XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns); > Ink ink = new Ink(); > foreach(XmlNode node in dataNodes) > { > string encodedInk = node.InnerText; > Ink tempInk = DecodeInk(encodedInk); > primaryInk.AddStrokesAtRectangle(s, r); > } > > Within Decode Ink, I do the following: > > Ink ink = new Ink(); > ink.Load(Convert.FromBase64String(encodedInk)); > return ink; > > The problem is this: When I call Ink.Load, the ink object throws an > exception: > > Catastrophic failure (Exception from HRESULT: 0x8000FFFF > (E_UNEXPECTED)) > > As far as I know, this only happens when the ink is in a format which > the Ink object does not understand. I tried changing my ink.Load call > to > ink.Load("base64:" + Convert.FromBase64String(encodedInk)); > ...but got the same result. > > Is the Ink for an InkDrawing encoded differently after IA (conversion > to InkWord)? I noticed a difference in the data, but assumed it was > normalizing strokes or something, no re-encoding data. Thanks for any > help! > > Ben >
|
|
It was an issue in my code - A bad xpath query led to erroneously trying to load data from an image instead of InkWord etc. I'll post again once I get to the InkWord loading. Thanks for the support guys!
b
On Jun 25, 4:49 pm, "Daniel Escapa [MS]" <not_r...[ at ]microsoft.com> wrote:
[Quoted Text] > Yes please send us the ISF...I will work with you offline. > > <ben...[ at ]gmail.com> wrote in message > > news:1182357744.190740.227640[ at ]o11g2000prd.googlegroups.com... > > > Hi - > > > I'm trying to query for ink in a certain region of a page within > > OneNote. My query works ok, and I end up iterating through InkWords, > > gathering ink as I go. My strategy was to build a primary Ink object, > > adding ink from each InkWord to it as I go. Some pseudocode: > > > XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns); > > Ink ink = new Ink(); > > foreach(XmlNode node in dataNodes) > > { > > string encodedInk = node.InnerText; > > Ink tempInk = DecodeInk(encodedInk); > > primaryInk.AddStrokesAtRectangle(s, r); > > } > > > Within Decode Ink, I do the following: > > > Ink ink = new Ink(); > > ink.Load(Convert.FromBase64String(encodedInk)); > > return ink; > > > The problem is this: When I call Ink.Load, the ink object throws an > > exception: > > > Catastrophic failure (Exception from HRESULT: 0x8000FFFF > > (E_UNEXPECTED)) > > > As far as I know, this only happens when the ink is in a format which > > the Ink object does not understand. I tried changing my ink.Load call > > to > > ink.Load("base64:" + Convert.FromBase64String(encodedInk)); > > ...but got the same result. > > > Is the Ink for an InkDrawing encoded differently after IA (conversion > > to InkWord)? I noticed a difference in the data, but assumed it was > > normalizing strokes or something, no re-encoding data. Thanks for any > > help! > > > Ben
|
|
Not a problem and please let us know what you are working on!
<benmca[ at ]gmail.com> wrote in message news:1182981369.696024.163080[ at ]d30g2000prg.googlegroups.com...
[Quoted Text] > It was an issue in my code - A bad xpath query led to erroneously > trying to load data from an image instead of InkWord etc. I'll post > again once I get to the InkWord loading. Thanks for the support > guys! > > b > > On Jun 25, 4:49 pm, "Daniel Escapa [MS]" <not_r...[ at ]microsoft.com> > wrote: >> Yes please send us the ISF...I will work with you offline. >> >> <ben...[ at ]gmail.com> wrote in message >> >> news:1182357744.190740.227640[ at ]o11g2000prd.googlegroups.com... >> >> > Hi - >> >> > I'm trying to query for ink in a certain region of a page within >> > OneNote. My query works ok, and I end up iterating through InkWords, >> > gathering ink as I go. My strategy was to build a primary Ink object, >> > adding ink from each InkWord to it as I go. Some pseudocode: >> >> > XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns); >> > Ink ink = new Ink(); >> > foreach(XmlNode node in dataNodes) >> > { >> > string encodedInk = node.InnerText; >> > Ink tempInk = DecodeInk(encodedInk); >> > primaryInk.AddStrokesAtRectangle(s, r); >> > } >> >> > Within Decode Ink, I do the following: >> >> > Ink ink = new Ink(); >> > ink.Load(Convert.FromBase64String(encodedInk)); >> > return ink; >> >> > The problem is this: When I call Ink.Load, the ink object throws an >> > exception: >> >> > Catastrophic failure (Exception from HRESULT: 0x8000FFFF >> > (E_UNEXPECTED)) >> >> > As far as I know, this only happens when the ink is in a format which >> > the Ink object does not understand. I tried changing my ink.Load call >> > to >> > ink.Load("base64:" + Convert.FromBase64String(encodedInk)); >> > ...but got the same result. >> >> > Is the Ink for an InkDrawing encoded differently after IA (conversion >> > to InkWord)? I noticed a difference in the data, but assumed it was >> > normalizing strokes or something, no re-encoding data. Thanks for any >> > help! >> >> > Ben > > >
|
|
|