English 中文(简体)
Can 我将重塑重新启动应用道路的浮舟路线的序号定下来。
原标题:Can I serialize the paths drawn on canvas for redrawing the paths on relaunch of the application

I have an application which uses the canvas to draw the scribbling done by the user. I have serialised the paths in an external file and kept it in the sd card. when user again launches the application then on a click of (ReDraw) Button I want the saved paths to be redrawn on the canvas. I am not able to redraw the paths. I am retrieving the paths from the file as I debugged and checked the same. But I don t have any idea as why the paths are not getting redrawn. Kindly help.

最佳回答

I took the reference from another question here I made few modifications and it worked for me quite well.

To understand we can think we just need to store a map of Actions and Points. We need path.moveTo(int x, int y), path.lineTo(int x, int y), path.quadTo(int x1, int y1, int x2, int y2) and path.reset() methods for scribbling.
Actions in this case being: lineTo, moveTo, quadTo, reset and points being the corresponding points.

我花了两个阵列,一个用于x,另一个用于 y。 就四氯(x1,y1,x2,y2)而言,我们需要两点,以便重新确定我们不需要任何点,而其他我们需要一点点(x,y)。
我们可以认为,行动是关键,{arrayX[],阵列......}是行动的价值。 行动: 面积为2个,重新确定规模为0个(或我们可以有两种阵列),而在这种情况下,我们不需要任何点。 我们刚刚需要谨慎,同时从与行动钥匙相对应的阵列中恢复各点的价值。 行动方针 我们只是走 can路。

问题回答

暂无回答




相关问题
Choosing the right subclass to instantiate programmatically

Ok, the context is some serialization / deserialization code that will parse a byte stream into an object representation that s easier to work with (and vice-versa). Here s a simplified example ...

WCF Problem Sending Object To Client

Background Converting from using .Net Remoting to WCF. Most of the methods on the WCF server are working fine, but ran into one that isn t working today. This is the service contract: [...

WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

deserialize the XML Document --- Need Help

I am using the below code snippet now to deserialize the XML document ... [WebMethod] public XmlDocument OrderDocument(XmlDocument xmlDoc) { XmlSerializer serializer = new XmlSerializer(typeof(...

How do I serialize a child class?

how do I include the serialized data from a child class where both impliment iserializeable? Class A Implements ISerializable dim _B as new B Class B Implements ISerializable ...

WCF: Serialize complex objects with read-only members

Looking for some guidance on a WCF service I’m prototyping. I have a WCF service hosted in IIS that will pass data to my clients. I have a separate shared assembly that contains all my business ...

Long/multiple SQL queries vs Serialization

I m trying to improve the performance of my web app where a page does a long query to pull data from different tables on a database. It pulls invoice data with multiple item lines, invoice status, and ...

热门标签