WO2013143471A1 - 触摸屏手写内容的存储方法、展示方法和终端设备 - Google Patents

触摸屏手写内容的存储方法、展示方法和终端设备 Download PDF

Info

Publication number
WO2013143471A1
WO2013143471A1 PCT/CN2013/073330 CN2013073330W WO2013143471A1 WO 2013143471 A1 WO2013143471 A1 WO 2013143471A1 CN 2013073330 W CN2013073330 W CN 2013073330W WO 2013143471 A1 WO2013143471 A1 WO 2013143471A1
Authority
WO
WIPO (PCT)
Prior art keywords
event
original
data
handwritten content
mark
Prior art date
Application number
PCT/CN2013/073330
Other languages
English (en)
French (fr)
Inventor
朱皓
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013143471A1 publication Critical patent/WO2013143471A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image

Definitions

  • the present invention relates to communication technologies, and in particular, to a method, a display method, and a terminal device for storing touch content on a touch screen. Background technique
  • the sender user handwrites input graphic or text on the touch screen of the sender terminal device, and the sender terminal device first stores the handwritten input content as a picture, and then sends the content to the picture in the form of a picture.
  • the receiving terminal device the receiving terminal device presents it to the recipient user in the form of a picture.
  • a first aspect of the present invention is to provide a method and a display method for a touch screen handwritten content, which are used to solve the defects in the prior art and save disk space and network traffic.
  • a first aspect of the present invention provides a method for storing handwritten content of a touch screen, including: acquiring a drawing event corresponding to handwritten content, drawing a line segment, user information, and original drawing size information;
  • the mark of the drawing event is used to indicate a type of the drawing event, and data of the drawing event a specific value corresponding to the content of the painting event;
  • a binary file is generated and stored, the binary file including: the user information, the original drawing size information, and the drawing unit array.
  • Another aspect of the present invention provides a method for displaying touch screen handwritten content, including: acquiring original drawing size information and a drawing unit array;
  • the image unit array And reading, by the image unit array, a mark of a drawing event corresponding to the handwritten content, data of the drawing event, and data of a drawing curve segment corresponding to the handwritten content, where the marking of the drawing event is used to indicate the drawing event Type, the data of the painting event is a specific value corresponding to the content of the painting event;
  • the handwritten content is drawn based on the mark of the drawing event, the data of the drawing event, and the data of the drawing curve line segment.
  • a terminal device including:
  • a handwritten content processing unit configured to acquire a drawing event corresponding to the handwritten content, a drawing curve line segment, user information, and original painting size information
  • An array processing unit configured to store the mark of the drawing event, the data of the drawing event, and the data of the drawing curve segment into an array of drawing units, where the marking of the drawing event is used to indicate the type of the drawing event,
  • the data of the drawing event is a specific value corresponding to the content of the drawing event;
  • a file processing unit configured to generate and store a binary file, the binary file comprising: the user information, the original drawing size information, and the drawing unit array.
  • a terminal device including:
  • An information receiving unit configured to acquire original painting size information and an image unit array
  • a data reading unit configured to read, from the drawing unit array, a mark of a drawing event corresponding to the handwritten content, data of the drawing event, and data of a drawing curve segment corresponding to the handwritten content, the marking of the drawing event Used to indicate the type of the painting event, the data of the painting event is a specific value corresponding to the content of the painting event;
  • a drawing unit configured to draw the handwritten content according to the mark of the drawing event, the data of the drawing event, and the data of the drawing curve line segment.
  • the data of the drawing event and the curve line segment are extracted from the handwritten content, the event and the data are recorded into the array, and the binary file is generated and stored according to the array, and the existing image file is used to store the handwriting.
  • the storage space occupied by the binary file carrying the same handwritten content is obviously smaller than the storage space occupied by the image, so the disk space can be saved.
  • the handwritten content is stored by the above method, and a large amount of network traffic can be saved when the stored content needs to be transmitted.
  • FIG. 1 is a flowchart of a method for storing handwritten content of a touch screen according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for storing handwritten content of a touch screen according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic diagram of handwritten content of a touch screen according to Embodiment 3 of the present invention
  • FIG. 4 is a flowchart of a method for displaying handwritten content of a touch screen according to Embodiment 4 of the present invention
  • FIG. 5 is a schematic structural diagram of a terminal device according to Embodiment 5 of the present invention
  • FIG. 6 is a schematic structural diagram of a terminal device according to Embodiment 6 of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • the following embodiments of the present invention are applied to an instant messaging network architecture, where the network architecture includes: a sender terminal device, a receiver terminal device, and an IM server that connects the sender terminal device and the receiver terminal device, and the IM server
  • the handwritten input content of the receiving terminal device is forwarded to Receiver terminal device.
  • the method for storing the touch screen handwritten content in the following embodiments is implemented by the sender terminal device, and may be implemented by a software module.
  • the display method of the touch screen handwritten content in the following embodiments is implemented by the receiver terminal device, and may be implemented by a software module.
  • FIG. 1 is a flowchart of a method for storing handwritten content of a touch screen according to Embodiment 1 of the present invention. As shown in Figure 1, the method includes the following process.
  • Step 101 Acquire a drawing event corresponding to the handwritten content, a drawing curve line segment, user information, and original painting size information.
  • the drawing curve segment may specifically adopt a Bezier curve segment.
  • Step 102 Store the mark of the drawing event, the data of the drawing event, and the data of the drawing curve line segment into the drawing unit array.
  • the mark of the drawing event is used to indicate the type of the drawing event, and identifies various events in the drawing process;
  • the data of the drawing event is a specific value corresponding to the content of the above event.
  • the painting event is marked as a marker of the brush color event, and the data of the corresponding painting event is the RGB color code corresponding to the brush color;
  • the painting event is marked as the mark of the starting point event, and the data of the corresponding painting event is the starting point X Coordinate values and y coordinate values.
  • the marking of the painting event may include: a marking of a brush color event, a marking of a brush width event, a marking of a background color event, a marking of a starting point event, and a marking of a termination point event.
  • the data of the painting event may include: an RGB color code corresponding to the brush color, a pixel value corresponding to the brush width, an RGB color code corresponding to the background color, an X coordinate value and a y coordinate value of the starting point, and an X coordinate value of the termination point. And y coordinate values, etc.
  • Step 103 Generate and store a binary file.
  • the binary file includes: user information, original drawing size information, and an array of drawing units.
  • the data of the drawing event and the curve line segment are extracted from the handwritten content, the event and the data are recorded into an array, and the binary file is generated and stored according to the array, and the existing image file is used.
  • the storage space occupied by the binary file carrying the same handwritten content is obviously smaller than the storage space occupied by the image, so that the disk space can be saved.
  • the handwritten content is stored by the above method, and a large amount of network traffic can be saved when the stored content needs to be transmitted to the receiver.
  • 2 is a flowchart of a method for storing handwritten content of a touch screen according to Embodiment 2 of the present invention.
  • the drawing curve line segment specifically adopts a Bezier curve line segment. As shown in FIG. 2, the method includes the following process.
  • Step 201 The sender terminal device acquires a drawing event, a Bezier curve segment, user information, and original drawing size information corresponding to the handwritten content.
  • the abscissa is represented by X and the ordinate is represented by y.
  • the user information may include: length information of the user identity (Identity) and an array of user IDs.
  • the user ID is stored in the user ID array.
  • the original painting size information may include: the maximum abscissa of the original drawing paper, the maximum ordinate of the original drawing paper, the minimum abscissa of the original handwritten content, the minimum ordinate of the original handwritten content, the maximum abscissa of the original handwritten content, and the original handwritten content. The maximum ordinate.
  • the sender terminal device can obtain the user information and the maximum abscissa of the original drawing paper and the maximum ordinate of the original drawing paper after being turned on.
  • the sender terminal device acquires the drawing event corresponding to the handwritten content and the Bezier curve segment.
  • the minimum abscissa of the original handwritten content is updated according to all the currently acquired Bezier segments. The minimum ordinate of the handwritten content, the maximum abscissa of the original handwritten content, and the maximum ordinate of the original handwritten content.
  • the painting event may specifically include, but is not limited to, the following kinds of events: a brush color event, a brush width event, a background color event, a start point event, and a termination point event.
  • the method for obtaining a brush color event is: public void recordColorChange(int color) ⁇
  • cDUSize + 2; where color is the RGB color code for the new brush color.
  • the method for obtaining a brush width event is:
  • cDUSize + 2; where size is the pixel value of the new brush width.
  • the method for obtaining the background color event is: public void recordBackColorChange(int color) ⁇
  • RGB color code for the new background color.
  • the method for obtaining the starting point event is: public void recordDUStart(int bx, int by) ⁇
  • cDUSize + 3; where bx is the x coordinate of the starting point and by is the y coordinate of the starting point.
  • the method for obtaining the termination event is: public void recordDUEnd(int ex, int ey) ⁇
  • cDUSize + 3; where ex is the x coordinate of the end point and ey is the y coordinate of the end point.
  • the method for obtaining a Bezier curve segment is: public void recordDU(int eX, int eY) ⁇
  • cDUSize + 2; where eX is the end point of the line segment and the x coordinate of the starting point of the next line segment, and eY is the line ending point and the y coordinate of the starting point of the next line segment.
  • Step 202 The sender terminal device stores the mark of the drawing event, the data of the drawing event, and the data of the Bessel curve line segment into the drawing unit array.
  • the drawing unit array is used to store the mark of the drawing event, the data of the drawing event, and the data of the Bezier line segment.
  • the marking of the painting event can include: the marking of the brush color event, the marking of the brush width event, the marking of the background color event, the marking of the starting point event and the ending point
  • the tag of the event For example, a preferred embodiment based on a 32-bit operating system is: Use an integer greater than 999999999 as the various event markers, the start point event is marked as 1000000000, the end point event is marked as 1000000001, and the brush color event is marked as 1000000002. The brush width event is marked 1000000003 and the background color event is marked 1000000004.
  • the sender terminal device initializes each of the above-mentioned drawing events, and through the initialization process, defines the tags corresponding to the respective drawing events.
  • the specific implementation method for the initialization of the drawing event by the sending terminal device is:
  • the sender terminal device also initializes the drawing unit array.
  • the drawing unit array uses an integer (int) array, and the drawing unit array cartridge is called DU (Draw Unit).
  • DU Draw Unit
  • a DU for recording the current handwritten content is initialized.
  • the method for initializing the DU is:
  • the order of execution of the above process of initializing the drawing event and the process of initializing the DU is not limited, and any one or both of them may be executed at the same time.
  • the mark of the above painting event, the data of the drawing event, and the data of the Bezier line segment are stored in the DU.
  • the data of the drawing event includes: an RGB color code corresponding to the brush color, a pixel value corresponding to the brush width, an RGB color code corresponding to the background color, an X coordinate value and a y coordinate value of the starting point, and an X coordinate value of the termination point and y coordinate value, etc.
  • an RGB color code corresponding to the brush color a pixel value corresponding to the brush width
  • an RGB color code corresponding to the background color an X coordinate value and a y coordinate value of the starting point
  • an X coordinate value of the termination point and y coordinate value etc.
  • the preset position of the RGB color code corresponding to the brush color is located at the next item of the mark of the brush color event; the preset position of the pixel value corresponding to the brush width is located after the mark of the brush width event One; the preset position of the RGB color code corresponding to the background color is located in the next item of the mark of the background color event; the preset position of the X coordinate value of the starting point is located at the next item of the mark of the start point event, y of the starting point The preset position of the coordinate value is located at the second item after the mark of the start point event; the preset position of the X coordinate value of the end point is located at the next item of the mark of the end point event, and the preset position of the y coordinate value of the end point is located The second item after the tag of the end point event.
  • one or more Bezier curve segments can be included, and the data of each Bezier curve segment is recorded in the DU. Still taking the above example based on a 32-bit operating system, the value of the data of the Bezier curve segment is less than 1000000000.
  • Step 203 The sender terminal device generates and stores a binary file.
  • the binary file includes: user information, original drawing size information, and an array of drawing units.
  • the user information may include: length information of the user identity (Identity, ID) and an array of user IDs.
  • the original painting size information may include: the maximum abscissa of the original drawing paper, the maximum ordinate of the original drawing paper, the minimum abscissa of the original handwritten content, the minimum ordinate of the original handwritten content, the maximum abscissa of the original handwritten content, and the original handwritten content.
  • the drawing unit array is an array of drawing units processed by the above step 202, and the array is stored Marks for painting events, data for painting events, and data for Bezier curve segments.
  • Table 1 is a table of binary file formats. Specifically, in a preferred embodiment, the binary file can be in the format described in Table 1.
  • the length of the first segment of the file is 4 bytes (byte), used to record the length information of the user ID; the length of the second segment of the file is the length of the user ID, used to record the user ID;
  • Each segment in paragraph 8 is 4 bytes long, recording the maximum abscissa of the original drawing paper, the maximum ordinate of the original drawing paper, the minimum abscissa of the original handwritten content, the minimum ordinate of the original handwritten content, and the original handwritten content.
  • Step 204 The sender terminal device sends a binary file to the receiver terminal device.
  • step 204 using mode 1, after performing step 203, the binary file has been stored, and the sender terminal device transmits the binary file to the recipient terminal device in step 204.
  • the mode 1 is specifically: the sender terminal device sends a handwritten message to the receiver terminal device,
  • the handwritten message carries the message type identifier and binary file of the binary file.
  • the first method is applicable to an application scenario of a normal handwritten message, and the binary file is delivered as a file.
  • the handwritten message can be sent by using an Extensible Messaging and Presence Protocol (XMPP) protocol.
  • XMPP Extensible Messaging and Presence Protocol
  • a specific example of the handwritten message message of mode one is:
  • Step 204 is an optional step of Embodiment 2 of the present invention.
  • the application scenario of the ordinary handwritten message described in step 204 corresponds to the above manner 1.
  • a whiteboard message is shared.
  • the second method is used instead of the first method, and the handwritten content is sent to the receiver.
  • the second mode after the step 202, the following steps are performed:
  • the sender terminal device sends a shared whiteboard message to the receiver terminal device, where the shared whiteboard message carries the message type identifier and the binary code of the binary code stream. flow.
  • the step of transmitting the shared whiteboard message to the receiving terminal device and the execution sequence of the foregoing step 203 are not limited and can be performed simultaneously. In the case where the above-described step of transmitting the shared whiteboard message to the receiving terminal device is performed, the above step 204 is not performed.
  • the second method is applicable to the application scenario in which the whiteboard message is shared, and the binary stream is delivered as a text message.
  • the shared whiteboard message can be sent by using the XMPP protocol.
  • a specific example of the shared whiteboard message in mode 2 is:
  • the ordinary handwritten message mode is adopted.
  • the sender user inputs the content to be sent, the sender sends the content to the receiver.
  • the second mode uses the shared whiteboard message mode, and the sender user performs handwriting input according to a certain The preset frequency, the handwritten content of the sender user is When sent to the recipient. For example, type and send "Hello" by handwriting.
  • mode 1 is adopted, the method of step 201 to step 203 is used to store the content of the user's handwriting input, until the user's handwriting input "hello" is completed, and the above is generated according to the handwritten content including the words "hello".
  • the binary is sent to the recipient.
  • the transmission frequency is set to 1 second
  • the user performs the handwriting input
  • the method of the above steps 201 to 202 is used every 1 second to obtain the content of the handwritten input of the user within 1 second.
  • the drawing unit array corresponding to the above content is sent to the receiver in a binary code stream.
  • the handwritten content is stored and transmitted by using an array method, and the binary file or the binary array composed of the array carrying the same handwritten content is occupied by the existing method of storing the handwritten content by using the image file.
  • the storage space is significantly smaller than the storage space occupied by the image, thus saving disk space and saving a lot of network traffic during transmission.
  • FIG. 3 is a flowchart of a method for displaying handwritten content of a touch screen according to Embodiment 3 of the present invention. As shown in Figure 3, the method includes the following process.
  • Step 301 Acquire original painting size information and an array of drawing units.
  • Step 302 Read the mark of the drawing event corresponding to the handwritten content, the data of the drawing event, and the data of the drawing curve segment corresponding to the handwritten content from the drawing unit array.
  • the mark of the drawing event is used to indicate the type of the drawing event, and identifies various events in the drawing process; the data of the drawing event is a specific value corresponding to the content of the above event.
  • the drawing curve segment may specifically adopt a Bezier curve segment.
  • Step 303 Draw handwritten content according to the mark of the drawing event, the data of the drawing event, and the data of the drawing curve segment.
  • the original drawing size information and the drawing unit array are obtained, the drawing event of the handwritten content and the data of the drawing curve line segment are read from the array, and the handwritten content is displayed and displayed to the user according to the event and the data, and
  • the storage space occupied by the array carrying the same handwritten content is obviously smaller than the storage space occupied by the image, thereby saving disk space and saving a large amount of network traffic during transmission.
  • FIG. 4 is a flowchart of a method for displaying handwritten content of a touch screen according to Embodiment 4 of the present invention.
  • the drawing curve segment specifically adopts a Bezier curve segment.
  • the method includes the following process.
  • Step 401 The receiving terminal device receives the binary file or the binary code stream, and obtains the original drawing. Draw size information and an array of drawing units.
  • the recipient terminal device acquires the original drawing size information and the drawing unit array from the sender terminal device.
  • the present step can be implemented by any one of the following methods 1 and 2.
  • the receiving terminal device receives a handwritten message from the sender terminal device, where the handwritten message carries the message type identifier and the binary file of the binary file.
  • the binary file includes: the above original drawing size information and the above-mentioned drawing unit array.
  • the original painting size information may include: a maximum abscissa of the original drawing paper, a maximum ordinate of the original drawing paper, a minimum abscissa of the original handwritten content, a minimum ordinate of the original handwritten content, a maximum abscissa of the original handwritten content, and The maximum ordinate of the original handwritten content.
  • the binary file may further include: user information.
  • the user information may include: a length information of the user ID and an array of user IDs.
  • the first method is applicable to an application scenario of a normal handwritten message, and the binary file is delivered as a file.
  • the handwritten message can be sent using the XMPP protocol.
  • a specific example of a handwritten message received in the first mode is:
  • the receiver terminal device knows that the file carried by the packet is a binary file according to the specific message type "application/du". Specifically, a preferred embodiment is that the format of the binary file is as shown in Table 1.
  • the receiving terminal device receives the shared whiteboard message from the sender terminal device, where the shared whiteboard message carries the message type identifier and the binary code stream of the binary code stream.
  • the binary code stream includes: the above original picture size information and the above-described drawing unit array.
  • the original painting size information may include: a maximum abscissa of the original drawing paper, a maximum ordinate of the original drawing paper, a minimum abscissa of the original handwritten content, a minimum ordinate of the original handwritten content, a maximum abscissa of the original handwritten content, and The maximum ordinate of the original handwritten content.
  • the binary code stream may further include: user information.
  • the user information may include: a length information of the user ID and an array of user IDs.
  • the second method is applicable to the application scenario of the shared whiteboard message, and the binary is delivered as a text message. Code stream.
  • the shared whiteboard message can be sent by using the XMPP protocol.
  • a specific example of the shared whiteboard message received by mode 2 is:
  • Step 402 The receiver terminal device reads the mark of the drawing event corresponding to the handwritten content, the data of the drawing event, and the data of the Bezier curve segment corresponding to the handwritten content from the drawing unit array.
  • Paint events can include: brush color events, brush width events, background color events, start point events, and end point events.
  • the preferred embodiment in the second embodiment of the present invention is still taken as an example.
  • an integer greater than 999999999 is used as various event tags.
  • Step 403 The receiver terminal device draws the handwritten content according to the mark of the drawing event, the data of the drawing event, and the data of the Bezier line segment.
  • the first step is based on the maximum abscissa of the original drawing paper, the maximum ordinate of the original drawing paper, the minimum abscissa of the original handwritten content, the minimum ordinate of the original handwritten content, the maximum abscissa of the original handwritten content, and the maximum of the original handwritten content.
  • the ordinate get the scaling parameters.
  • the zoom parameter is represented by "zoomsize".
  • the playback speed parameter is to perform the handwriting
  • the content shows the sleep time of the thread or process of the method.
  • the speed parameter is represented by "sleepTime".
  • the value of the playback speed parameter can be updated at any time according to the user's settings.
  • the value of the playback speed parameter must be greater than or equal to 0, and there is no upper limit requirement.
  • the handwritten content is drawn based on the scaling parameters, the marking of the drawing event, the data of the drawing event, and the data of the Bessel curve segment.
  • the specific drawing method of the second step includes: setting the brush color according to the mark of the brush color event and the data of the brush color event; setting the brush width according to the mark of the brush width event and the data of the brush width event; marking according to the background color event and The background color event data, set the background color; draw the starting point according to the mark of the start point event, the data of the start point event, and the zoom parameter; draw the end point according to the mark of the end point event, the data of the end point event, and the zoom parameter;
  • the Bezier curve is drawn based on the data of the Bezier curve segment and the scaling parameters.
  • DU[i] When the value of DU[i] is less than 1000000000, it means that the data of the Bezier line segment is obtained, and the coordinates of the previous point are read from the current position and read from the current position to the last two items.
  • the preferred embodiment of the second embodiment of the present invention is used as an example.
  • the currently obtained marker, brush width event which is neither a brush color event.
  • a future-oriented extension is implemented.
  • a parameter can be added, which takes "Number” as an example, and the parameter is used to indicate that the tag of the newly added event needs to be occupied.
  • the number of items in the DU if the currently used handwritten content display method cannot resolve the newly added event, then the read-only
  • the Number parameter then skip the currently read item and continue reading the next item in the drawing unit array.
  • the drawing event of the handwritten content and the data of the Bezier curve segment are read from the array, and the handwritten content is displayed according to the event and the data.
  • a binary consisting of an array carrying the same handwritten content
  • the storage space occupied by the file or binary stream is significantly smaller than the storage space occupied by the image, thus saving disk space and saving a lot of network traffic during transmission.
  • the drawing speed can be adjusted to generate an animation effect, the handwritten content is dynamically displayed in the writing order, and the writing process is presented to the user of the recipient.
  • FIG. 5 is a schematic structural diagram of a terminal device according to Embodiment 5 of the present invention. As shown in FIG. 5, the apparatus at least includes: a handwritten content processing unit 51, an array processing unit 52, and a file processing unit 53.
  • the handwritten content processing unit 51 is configured to acquire a drawing event corresponding to the handwritten content, a drawing curve segment, user information, and original drawing size information.
  • the drawing curve segment may specifically adopt a Bezier curve segment.
  • the array processing unit 52 is configured to store the mark of the drawing event, the data of the drawing event, and the data of the drawing curve segment to the drawing unit array, the mark of the drawing event is used to indicate the type of the drawing event, and the data of the drawing event is a drawing event.
  • the file processing unit 53 is for generating and storing a binary file.
  • the above binary file includes: the above user information, the above-mentioned original drawing size information, and the above-described drawing unit array.
  • the painting events include: a brush color event, a brush width event, a background color event, a start point event, and a termination point event.
  • the above user information includes: length information of the user identity ID and an array of user IDs.
  • the above original painting size information includes: the maximum abscissa of the original drawing paper, the maximum ordinate of the original drawing paper, the minimum abscissa of the original handwritten content, the minimum ordinate of the original handwritten content, the maximum abscissa of the original handwritten content, and the original handwritten content. The maximum ordinate.
  • the device may further include a first sending unit 54.
  • the first sending unit 54 is configured to send a handwritten message to the receiver terminal device.
  • the handwritten message carries the message type identifier of the binary file and the binary file.
  • the device may further include a second sending unit 55.
  • the second sending unit 55 is configured to send a shared whiteboard message message to the receiver terminal device.
  • the shared whiteboard message carries the message type identifier of the binary stream and the binary stream, and the binary stream includes the original drawing size information and the drawing unit array.
  • the handwritten content processing unit extracts the data of the drawing event and the drawing curve segment from the handwritten content
  • the array processing unit records the event and the data into the array
  • the file processing unit generates the binary file according to the array.
  • store save with existing image files
  • the storage space occupied by the binary file which carries the same handwritten content is obviously smaller than the storage space occupied by the image, so that the disk space can be saved.
  • the above device is used to store the handwritten content, and when the stored content needs to be sent to the receiver, a large amount of network traffic can be saved.
  • FIG. 6 is a schematic structural diagram of a terminal device according to Embodiment 6 of the present invention.
  • the apparatus includes at least: an information receiving unit 61, a data reading unit 62, and a drawing unit 63.
  • the information receiving unit 61 is configured to acquire an original painting size information and an array of drawing units 63.
  • the data reading unit 62 is configured to read, from the array of the drawing units 63, the mark of the drawing event corresponding to the handwritten content, the data of the drawing event, and the data of the drawing curve segment corresponding to the handwritten content, and the mark of the drawing event is used to indicate the drawing.
  • the type of event, the data of the painting event is the specific value corresponding to the content of the painting event.
  • the drawing curve segment may specifically adopt a Bezier curve segment.
  • the drawing unit 63 is configured to draw the handwritten content based on the mark of the drawing event, the data of the drawing event, and the data of the drawing curve segment.
  • the original painting size information includes: a maximum abscissa of the original drawing paper, a maximum ordinate of the original drawing paper, a minimum abscissa of the original handwritten content, a minimum ordinate of the original handwritten content, The maximum abscissa of the original handwritten content and the maximum ordinate of the original handwritten content.
  • the above painting events include: brush color events, brush width events, background color events, start point events, and end point events.
  • the drawing unit 63 is specifically configured to use the maximum abscissa of the original drawing paper, the maximum ordinate of the original drawing paper, the minimum abscissa of the original handwritten content, and the minimum vertical of the original handwritten content.
  • the above drawing unit 63 is also specifically used in the slave When the current item read by the array unit 63 does not belong to the mark of the drawing event and the data of the drawing curve segment, the next item of the array of the drawing unit 63 is continuously read.
  • the information receiving unit 61 is specifically configured to receive a handwritten message from the sender terminal device, where the handwritten message carries the message type identifier of the binary file and the binary file, and the binary
  • the file includes: user information, the above-mentioned original drawing size information, and an array of the above-mentioned drawing units 63.
  • the user information includes: length information of the user identity ID and an array of user IDs.
  • the information receiving unit 61 is configured to receive a shared whiteboard message from the sender terminal device, where the shared whiteboard message carries a message type identifier of the binary stream and the binary stream, and the binary stream includes the original drawing.
  • the size information and the above-mentioned drawing unit 63 array are configured to receive a shared whiteboard message from the sender terminal device, where the shared whiteboard message carries a message type identifier of the binary stream and the binary stream, and the binary stream includes the original drawing.
  • the data reading unit reads the drawing event of the handwritten content and the data of the drawing curve line segment from the array of the file, and the drawing unit is based on The event and data draw handwritten content is displayed to the user.
  • the storage space occupied by the array carrying the same handwritten content is obviously smaller than the storage space occupied by the image, thereby saving the disk. Space, and can save a lot of network traffic when transmitting.
  • the first embodiment of the present invention and the second embodiment of the present invention can refer to the third embodiment of the present invention.
  • the constituent units can be set simultaneously with the same terminal device.
  • the aforementioned program can be stored in a computer Read in the storage medium.
  • the steps including the foregoing method embodiments are performed; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明提供一种触摸屏手写内容的存储方法、展示方法和终端设备。存储方法包括:获取手写内容对应的绘画事件、绘画曲线线段、用户信息和原始绘画尺寸信息;将绘画事件的标记、绘画事件的数据和绘画曲线线段的数据存储到绘画单元数组;生成并存储包括用户信息、原始绘画尺寸信息和绘画单元数组的二进制文件。展示方法包括:从绘画单元数组中读取手写内容对应的绘画事件的标记、绘画事件的数据和手写内容对应的绘画曲线线段的数据;根据绘画事件的标记、绘画事件的数据和绘画曲线线段的数据绘制手写内容。采用本发明提供的触摸屏手写内容的存储方法、展示方法和终端设备,能够节约磁盘空间和网络流量。

Description

说 明 书
触摸展手写内容的存储方法、 展示方法和终端设备 本申请要求于 2012 年 3 月 28 日提交中国专利局、 申请号为 201210085652.0、 发明名称为 "触摸屏手写内容的存储方法、 展示方法和终 端设备" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术, 尤其涉及一种触摸屏手写内容的存储方法、 展示 方法和终端设备。 背景技术
随着智能手机、 平板电脑等具备触摸屏输入能力的电子产品以及微 信、 米聊等即时通信 ( Instant Messaging , 筒称 ΙΜ )软件的快速发展, 越 来越多的用户使用上述电子产品采用手写输入方式通过即时通信软件进 行即时通信。
在上述即时通信过程中, 发送方用户在发送方终端设备的触摸屏上手写 输入图形或文字等内容, 发送方终端设备先将手写输入的内容存储为图片, 然后以图片的形式将该内容发送到接收方终端设备, 接收方终端设备以图片 的形式将其展示给接收方用户。
由于图片数据所占存储空间较大, 一幅 10个字 240*84像素的图片大小 约为 3Kb。 因此采用上述现有的手写输入内容的存储、 传输和展示方法, 在 终端设备上需要占用大量的磁盘空间, 并且在传输过程中需要占用大量的网 络流量。 发明内容 本发明的第一个方面是提供一种触摸屏手写内容的存储方法和展示方 法, 用以解决现有技术中的缺陷, 节约磁盘空间和网络流量。
本发明的另一个方面是提供一种终端设备,用以解决现有技术中的缺陷, 节约磁盘空间和网络流量。 本发明的第一个方面是提供一种触摸屏手写内容的存储方法, 包括: 获取手写内容对应的绘画事件、 绘画曲线线段、 用户信息和原始绘画尺 寸信息;
将所述绘画事件的标记、 所述绘画事件的数据和所述绘画曲线线段的数 据存储到绘画单元数组,所述绘画事件的标记用于指示所述绘画事件的类型, 所述绘画事件的数据为所述绘画事件的内容对应的具体数值;
生成并存储二进制文件, 所述二进制文件包括: 所述用户信息、 所述原 始绘画尺寸信息和所述绘画单元数组。
本发明的另一个方面是提供一种触摸屏手写内容的展示方法, 包括: 获取原始绘画尺寸信息和绘画单元数组;
从所述绘画单元数组中读取手写内容对应的绘画事件的标记、 所述绘画 事件的数据和所述手写内容对应的绘画曲线线段的数据, 所述绘画事件的标 记用于指示所述绘画事件的类型, 所述绘画事件的数据为所述绘画事件的内 容对应的具体数值;
根据所述绘画事件的标记、 所述绘画事件的数据和所述绘画曲线线段的 数据绘制所述手写内容。
本发明的又一个方面是提供一种终端设备, 包括:
手写内容处理单元, 用于获取手写内容对应的绘画事件、 绘画曲线线段、 用户信息和原始绘画尺寸信息;
数组处理单元, 用于将所述绘画事件的标记、 所述绘画事件的数据和所 述绘画曲线线段的数据存储到绘画单元数组, 所述绘画事件的标记用于指示 所述绘画事件的类型, 所述绘画事件的数据为所述绘画事件的内容对应的具 体数值;
文件处理单元, 用于生成并存储二进制文件, 所述二进制文件包括: 所 述用户信息、 所述原始绘画尺寸信息和所述绘画单元数组。
本发明的又一个方面是提供一种终端设备, 包括:
信息接收单元, 用于获取原始绘画尺寸信息和绘画单元数组;
数据读取单元, 用于从所述绘画单元数组中读取手写内容对应的绘画事 件的标记、所述绘画事件的数据和所述手写内容对应的绘画曲线线段的数据, 所述绘画事件的标记用于指示所述绘画事件的类型, 所述绘画事件的数据为 所述绘画事件的内容对应的具体数值;
绘画单元, 用于根据所述绘画事件的标记、 所述绘画事件的数据和所述 绘画曲线线段的数据绘制所述手写内容。
根据上述发明内容可见, 从手写内容中提取出绘画事件和绘画曲线线段 的数据, 将上述事件和数据记录到数组中, 并根据该数组生成二进制文件并 存储, 与现有的采用图片文件存储手写内容的方式相比, 由于携带相同手写 内容的数组构成的二进制文件所占的存储空间明显小于图片所占的存储空 间, 因此可以节约磁盘空间。 并且, 采用上述方法存储手写内容, 在需要将 该存储的内容进行发送时, 可以节省大量的网络流量。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例一的触摸屏手写内容的存储方法的流程图; 图 2为本发明实施例二的触摸屏手写内容的存储方法的流程图; 图 3为本发明实施例三的触摸屏手写内容的展示方法的流程图; 图 4为本发明实施例四的触摸屏手写内容的展示方法的流程图; 图 5为本发明实施例五的终端设备的结构示意图;
图 6为本发明实施例六的终端设备的结构示意图。 具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明的下述各个实施例应用于即时通信网络架构中, 该网络架构中包 括: 发送方终端设备、 接收方终端设备以及连接发送方终端设备和接收方终 端设备的 IM服务器, 由 IM服务器将接收方终端设备的手写输入内容转发给 接收方终端设备。 以下实施例中的触摸屏手写内容的存储方法由发送方终端 设备实现, 具体可以通过软件模块实现; 以下实施例中的触摸屏手写内容的 展示方法由接收方终端设备实现, 具体可以通过软件模块实现。
图 1 为本发明实施例一的触摸屏手写内容的存储方法的流程图。 如图 1 所示, 该方法包括以下过程。
步骤 101 : 获取手写内容对应的绘画事件、 绘画曲线线段、 用户信息和 原始绘画尺寸信息。
在本发明一种较佳的实施方式中, 该绘画曲线线段具体可以采用贝塞尔 曲线线段。
步骤 102: 将绘画事件的标记、 绘画事件的数据和绘画曲线线段的数据 存储到绘画单元数组。
在本步骤中, 绘画事件的标记用于指示绘画事件的类型, 标识绘画过程 中的各种事件; 绘画事件的数据为上述事件的内容对应的具体数值。 例如, 绘画事件标记为画笔颜色事件的标记, 其对应的绘画事件的数据为画笔颜色 对应的 RGB颜色代码; 绘画事件标记为起始点事件的标记, 其对应的绘画事 件的数据为起始点的 X坐标值和 y坐标值。 在一种较佳的实施方式中, 绘画 事件的标记可以包括: 画笔颜色事件的标记、 画笔宽度事件的标记、 背景颜 色事件的标记、 起始点事件的标记和终止点事件的标记等。 相应地, 绘画事 件的数据可以包括:画笔颜色对应的 RGB颜色代码、画笔宽度对应的像素值、 背景颜色对应的 RGB颜色代码、 起始点的 X坐标值和 y坐标值、 终止点的 X 坐标值和 y坐标值等。
步骤 103: 生成并存储二进制文件。
在本步骤中, 该二进制文件包括: 用户信息、 原始绘画尺寸信息和绘画 单元数组。
在本发明实施例一中, 从手写内容中提取出绘画事件和绘画曲线线段的 数据, 将上述事件和数据记录到数组中, 并根据该数组生成二进制文件并存 储, 与现有的采用图片文件存储手写内容的方式相比, 由于携带相同手写内 容的数组构成的二进制文件所占的存储空间明显小于图片所占的存储空间, 因此可以节约磁盘空间。 并且, 采用上述方法存储手写内容, 在需要将该存 储的内容发送到接收方时, 可以节省大量的网络流量。 图 2为本发明实施例二的触摸屏手写内容的存储方法的流程图。 在本发 明实施例二中, 绘画曲线线段具体采用贝塞尔曲线线段。 如图 2所示, 该方 法包括以下过程。
步骤 201 : 发送方终端设备获取手写内容对应的绘画事件、 贝塞尔曲线 线段、 用户信息和原始绘画尺寸信息。
在本发明的各个实施例中, 以 X表示横坐标, 以 y表示纵坐标。
具体地, 用户信息可以包括: 用户身份标识(Identity, 筒称 ID )的长度 信息和用户 ID数组。 该用户 ID数组中存储着用户 ID。 原始绘画尺寸信息可 以包括: 原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内容的 最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标和原 始手写内容的最大纵坐标。
在本步骤中, 发送方终端设备在开机后即可获取用户信息以及原始画纸 的最大横坐标和原始画纸的最大纵坐标。
在用户开始手写输入时,发送方终端设备获取手写内容对应的绘画事件、 贝塞尔曲线线段。 对于一次手写输入, 包括多条贝塞尔曲线线段, 在每获取 一条新的贝塞尔曲线线段之后,根据当前已经获取到的全部贝塞尔曲线线段, 更新原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手写内 容的最大横坐标和原始手写内容的最大纵坐标。
具体地, 绘画事件具体可以包括但不限于以下种类的事件: 画笔颜色事 件、 画笔宽度事件、 背景颜色事件、 起始点事件和终止点事件。
具体地, 在一种较佳的实施方式中, 获取画笔颜色事件的方法为: public void recordColorChange(int color) {
currentDU[cDUSize] = SET_STROKE_COLOR;
currentDU[cDUSize + 1] = color;
cDUSize += 2; 其中, color为新画笔颜色的 RGB颜色代码。
具体地, 在一种较佳的实施方式中, 获取画笔宽度事件的方法为:
public void recordWidthChange(int size) {
currentDU[cDUSize] = SET_STROKE_WIDTH; currentDU[cDUSize + 1] = size;
cDUSize += 2; 其中, size为新画笔宽度的像素值。
具体地, 在一种较佳的实施方式中, 获取背景颜色事件的方法为: public void recordBackColorChange(int color) {
currentDU[cDUSize] = SET_BACK_COLOR;
currentDU[cDUSize + 1] = color;
cDUSize += 2;
}
其中, color为新背景颜色的 RGB颜色代码。
具体地, 在一种较佳的实施方式中, 获取起始点事件的方法为: public void recordDUStart(int bx, int by) {
currentDU [cDUSize] = START—DRAW;
currentDU [cDUSize + 1] = bx;
currentDU [cDUSize + 2] = by;
cDUSize += 3; 其中, bx为起始点的 x坐标, by为起始点的 y坐标。
具体地, 在一种较佳的实施方式中, 获取终止点事件的方法为: public void recordDUEnd(int ex, int ey) {
currentDU [cDUSize] = END—DRAW;
currentDU [cDUSize + 1] = ex;
currentDU [cDUSize + 2] = ey;
cDUSize += 3; 其中, ex为终止点的 x坐标, ey为终止点的 y坐标。
具体地, 在一种较佳的实施方式中, 获取贝塞尔曲线线段的方法为: public void recordDU(int eX, int eY) {
currentDU [cDUSize] = eX; currentDU[cDUSize + 1] = eY;
cDUSize += 2; 其中, eX为此线段终止点兼下一线段起始点的 x坐标, eY为此线段终 止点兼下一线段起始点的 y坐标。
步骤 202: 发送方终端设备将绘画事件的标记、 绘画事件的数据和贝塞 尔曲线线段的数据存储到绘画单元数组。
在本步骤中, 该绘画单元数组用于存储绘画事件的标记、 绘画事件的数 据和贝塞尔曲线线段的数据。 对于绘画事件中包含的不同种类的事件分别采 用不同的标记, 则绘画事件的标记可以包括: 画笔颜色事件的标记、 画笔宽 度事件的标记、 背景颜色事件的标记、 起始点事件的标记和终止点事件的标 记。 例如, 一个基于 32位操作系统的较佳的实施例为: 采用大于 999999999 的整数作为各种事件标记, 起始点事件的标记为 1000000000, 终止点事件的 标记为 1000000001 , 画笔颜色事件的标记为 1000000002, 画笔宽度事件的标 记为 1000000003 , 背景颜色事件的标记为 1000000004。
在本步骤中, 发送方终端设备对上述各个绘画事件进行初始化, 通过初 始化过程, 定义上述各个绘画事件对应的标记。 以上述基于 32位操作系统的 实施例为例, 发送方终端设备进行绘画事件初始化的具体实现方法为:
public final static int START_DRAW = 1000000000;//设置起始点事件的标 记为 1000000000。
public final static int END_DRAW = 1000000001;//设置终止点事件的标记 为 1000000001。
public final static int SET_STROKE_COLOR = 1000000002;〃设置画笔颜 色事件的标记为 1000000002。
public final static int SET—STROKE—WIDTH = 1000000003;〃设置画笔宽 度事件的标记为 1000000003。
public final static int SET _BACK_COLOR = 1000000004;//设置背景色事 件的标记为 1000000004。
在本步骤中, 发送方终端设备还对绘画单元数组进行初始化。 该绘画单 元数组采用整型 (int )数组, 将该绘画单元数组筒称为 DU ( Draw Unit ) 。 在本步骤中, 初始化一个用于记录当前手写内容的 DU。 具体地, 在一种较佳 的实施方式中, 初始化 DU的方法为:
int cDUlength = 102400;//初始化数组大小
int cDUsize=0;〃当前 i己录位置
int[] currentDU = new int[cDUlength];〃初始 4匕数组
上述对绘画事件进行初始化的过程和对 DU进行初始化的过程之间的执 行顺序不受限制, 可以先执行其中任意一者或者二者同时执行。
在完成 DU的初始化后, 将上述绘画事件的标记、 绘画事件的数据和贝 塞尔曲线线段的数据存储到 DU中。
具体地, 绘画事件的数据包括: 画笔颜色对应的 RGB颜色代码、 画笔宽 度对应的像素值、 背景颜色对应的 RGB颜色代码、起始点的 X坐标值和 y坐 标值、 终止点的 X坐标值和 y坐标值等。 在向 DU存储绘画事件的标记和绘 画事件的数据时, 在 DU中为各种不同种类的绘画事件的数据分别预设不同 的位置。在一种较佳的实施方式中, 画笔颜色对应的 RGB颜色代码的预设位 置位于画笔颜色事件的标记的后一项; 画笔宽度对应的像素值的预设位置位 于画笔宽度事件的标记的后一项;背景颜色对应的 RGB颜色代码的预设位置 位于背景颜色事件的标记的后一项; 起始点的 X坐标值的预设位置位于起始 点事件的标记的后一项, 起始点的 y坐标值的预设位置位于起始点事件的标 记之后的第二项; 终止点的 X坐标值的预设位置位于终止点事件的标记的后 一项, 终止点的 y坐标值的预设位置位于终止点事件的标记之后的第二项。
在一次手写内容中,可以包括一条或多于一条的贝塞尔曲线线段,在 DU 中分别记录每一条贝塞尔曲线线段的数据。 仍以上述基于 32位操作系统为 例, 贝塞尔曲线线段的数据的值均小于 1000000000。
步骤 203: 发送方终端设备生成并存储二进制文件。
在本步骤中, 该二进制文件包括: 用户信息、 原始绘画尺寸信息和绘画 单元数组。 具体地, 用户信息可以包括: 用户身份标识 (Identity, 筒称 ID ) 的长度信息和用户 ID数组。原始绘画尺寸信息可以包括: 原始画纸的最大横 坐标、 原始画纸的最大纵坐标、 原始手写内容的最小横坐标、 原始手写内容 的最小纵坐标、 原始手写内容的最大横坐标和原始手写内容的最大纵坐标。 该绘画单元数组为经过上述步骤 202处理后的绘画单元数组, 该数组中存储 着绘画事件的标记、 绘画事件的数据和贝塞尔曲线线段的数据。
表 1为二进制文件格式表。 具体地, 在一种较佳的实施方式中, 二进制 文件可以采用表 1中记载的格式。 以二进制文件进行存储, 文件第 1段长度 为 4字节 (byte ), 用于记录用户 ID的长度信息; 文件第 2段长度为用户 ID 的长度, 用于记录用户 ID; 文件第 3段至第 8段中每一段的长度为 4字节, 分别记录原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内容的 最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标和原 始手写内容的最大纵坐标; 文件的第 9段开始用于存储上述绘画单元数组 DU,以 1 int = 4 byte的方式,将 DU中的项依次转化为字节写入二进制文件, 直至将 DU中的项全部存储完毕。 表 1. 二进制文件格式表
Figure imgf000010_0001
步骤 204: 发送方终端设备向接收方终端设备发送二进制文件。
在本发明实施例二中, 具体可以采用两种实施方式, 使发送方终端设备 向接收方终端设备发送手写内容, 即方式一和方式二。 具体地, 在步骤 204 中, 采用方式一, 在执行完步骤 203之后, 已经存储了二进制文件, 发送方 终端设备在步骤 204中向接收方终端设备发送该二进制文件。
方式一具体为: 发送方终端设备向接收方终端设备发送手写消息报文, 该手写消息报文中携带二进制文件的消息类型标识和二进制文件。 方式一适用于普通手写消息的应用情景,以文件方式传递该二进制文件。 该手写消息报文可以采用采用可扩展消息与存在协议(Extensible Messaging and Presence Protocol , 筒称 XMPP )协议发送。 方式一的手写消息报文的一 个具体实例为:
<message id="xc3S4-42" to="juliet@ cn.hotalk.com" from="romeo@ cn.hotalk.com/android" type="chat"><body/><thread>DAooyN</threadxdata xmlns= "urn: xmp :bob "xitemxbob cid="2263" max-age="0" type=" application/du"x/bobx/item></data></message>
其中, type=" application/du"为二进制文件的消息类型标识, 采用特定的 消息类型 "application/du"标识该二进制文件。
步骤 204为本发明实施例二的可选步骤。 步骤 204描述的普通手写消息 的应用情景对应上述方式一。 除了上述步骤 204描述的普通手写消息的应用 情景, 还存在共享白板消息的应用情景。 在共享白板消息的应用情景中, 采 用方式二替代上述方式一, 向接收方发送手写内容。 对于采用方式二的情况, 在步骤 202之后, 执行以下步骤: 发送方终端设备向接收方终端设备发送共 享白板消息报文, 该共享白板消息报文中携带二进制码流的消息类型标识和 二进制码流。
以上向接收方终端设备发送共享白板消息报文的步骤与上述步骤 203的 执行顺序不受限制, 可以同时执行。 在执行了上述向接收方终端设备发送共 享白板消息报文的步骤的情况下, 不再执行上述步骤 204。 方式二适用于共 享白板消息的应用情景, 以文本消息方式传递二进制码流。 该共享白板消息 报文可以采用 XMPP协议发送。 方式二的共享白板消息报文的一个具体实例 为:
<message id="xc3S4-42" to="juliet@ cn.hotalk.com" fro m="romeo@ cn.hotalk.com/andro id" type="draw"><body>G*&TY3*Teg2Jo</body><thread>DAooyN</thread></message>
其中, type="dmW"为二进制码流的消息类型标识, 采用特定的消息类型 "draw"标识该二进制码流。
上述方式一采用普通的手写消息方式, 当发送方用户将需要发送的内容 输入完毕后, 再向接收方发送; 方式二采用共享白板消息方式, 在发送方用 户进行手写输入的同时, 根据一定的预设频率, 将发送方用户的手写内容即 时发送给接收方。 例如, 通过手写输入并发送 "你好" 字样。 如果采用方式 一, 采用上述步骤 201至步骤 203的方法存储用户手写输入的内容, 直至用 户手写输入 "你好" 两个字均完成后, 根据包含 "你好" 两个字的手写内容 生成上述二进制文件并发送给接收方。 如果采用方式二, 例如将发送频率设 置为 1秒,则在用户手写输入的同时,每隔 1秒采用上述步骤 201至步骤 202 的方法, 获取用户在这 1秒内的手写输入的内容, 将上述内容对应的绘画单 元数组采用二进制码流发送给接收方。
在本发明实施例二中, 采用数组方式对手写内容进行存储并传送, 与现 有的采用图片文件存储手写内容的方式相比, 携带相同手写内容的数组构成 的二进制文件或二进制数组所占的存储空间明显小于图片所占的存储空间, 因此可以节约磁盘空间, 并且在传输时可以节省大量的网络流量。
图 3为本发明实施例三的触摸屏手写内容的展示方法的流程图。 如图 3 所示, 该方法包括以下过程。
步骤 301 : 获取原始绘画尺寸信息和绘画单元数组。
步骤 302: 从绘画单元数组中读取手写内容对应的绘画事件的标记、 绘 画事件的数据和手写内容对应的绘画曲线线段的数据。
在本步骤中, 绘画事件的标记用于指示绘画事件的类型, 标识绘画过程 中的各种事件; 绘画事件的数据为上述事件的内容对应的具体数值。 在本发 明一种较佳的实施方式中, 该绘画曲线线段具体可以采用贝塞尔曲线线段。
步骤 303: 根据绘画事件的标记、 绘画事件的数据和绘画曲线线段的数 据绘制手写内容。
在本发明实施例三中, 获取原始绘画尺寸信息和绘画单元数组, 从该数 组中读取手写内容的绘画事件和绘画曲线线段的数据, 根据该事件和数据绘 制手写内容展示给用户, 与现有的采用图片文件展示手写内容的方式相比, 携带相同手写内容的数组所占的存储空间明显小于图片所占的存储空间, 因 此可以节约磁盘空间, 并且在传输时可以节省大量的网络流量。
图 4为本发明实施例四的触摸屏手写内容的展示方法的流程图。 在本发 明实施例四中, 该绘画曲线线段具体采用贝塞尔曲线线段。 如图 4所示, 该 方法包括如下过程。
步骤 401 : 接收方终端设备接收二进制文件或二进制码流, 获取原始绘 画尺寸信息和绘画单元数组。
在本步骤中, 接收方终端设备从发送方终端设备获取原始绘画尺寸信息 和绘画单元数组。 具体地, 可以采用以下方式一和方式二中的任意一种来实 现本步骤。
方式一: 接收方终端设备从发送方终端设备接收手写消息报文, 该手写 消息报文中携带二进制文件的消息类型标识和二进制文件。 该二进制文件包 括: 上述原始绘画尺寸信息和上述绘画单元数组。 其中, 该原始绘画尺寸信 息可以包括: 原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内 容的最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标 和原始手写内容的最大纵坐标。
进一步地, 该二进制文件中还可以包括: 用户信息。 其中, 该用户信息 可以包括: 用户 ID的长度信息和用户 ID数组。
方式一适用于普通手写消息的应用情景,以文件方式传递该二进制文件。 该手写消息报文可以采用 XMPP协议发送。 采用方式一接收到的手写消息报 文的一个具体实例为:
<message id="xc3S4-42" to="juliet @ cn.hotalk. com" fro m="romeo@ cn.hotalk.com/andro id" type="chat"><body/><thread>DAooyN</threadxdata xmlns= "urn: xmpp :bob" xitemxbob cid="2263" max-age="0" type=" application/du"x/bobx/item></data></message>
其中, type=" application/du"为二进制文件的消息类型标识, 接收方终端 设备根据特定的消息类型 "application/du"标识,获知该报文携带的文件为二进 制文件。 具体地, 一种较佳的实施方式为, 该二进制文件的格式如表 1所示。
方式二: 接收方终端设备从发送方终端设备接收共享白板消息报文, 该 共享白板消息报文中携带二进制码流的消息类型标识和二进制码流。 该二进 制码流包括: 上述原始绘画尺寸信息和上述绘画单元数组。 其中, 该原始绘 画尺寸信息可以包括: 原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原 始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最 大横坐标和原始手写内容的最大纵坐标。
可选地, 该二进制码流中还可以包括: 用户信息。 其中, 该用户信息可 以包括: 用户 ID的长度信息和用户 ID数组。
方式二适用于共享白板消息的应用情景, 以文本消息方式传递该二进制 码流。 该共享白板消息报文可以采用 XMPP协议发送。 采用方式二接收到的 共享白板消息报文的一个具体实例为:
<message id="xc3S4-42" to="juliet @ cn.hotalk. com" fro m=nromeo@ cn.hotalk.com/andro id'' type:" draw "><body> G*&TY3*Teg2Jo </bodyxthread>DAooyN</threadx/message>
其中, type="dmW"为二进制码流的消息类型标识, 接收方终端设备根据特 定的消息类型 "draw"标识, 获知该 4艮文携带二进制码流。
步骤 402: 接收方终端设备从绘画单元数组中读取手写内容对应的绘画 事件的标记、 绘画事件的数据和手写内容对应的贝塞尔曲线线段的数据。
绘画事件可以包括: 画笔颜色事件、 画笔宽度事件、 背景颜色事件、 起 始点事件和终止点事件。
在本步骤中, 仍以本发明实施例二中的较佳的实施例为例, 对于基于 32 位操作系统, 采用大于 999999999的整数作为各种事件标记。 当从绘画单元 数组中读取到一项值为 1000000000时, 获取该项为起始点事件的标记; 当从 绘画单元数组中读取到一项值为 1000000001时,获取该项为终止点事件的标 记; 当从绘画单元数组中读取到一项值为 1000000002时, 获取该项为画笔颜 色事件的标记; 当从绘画单元数组中读取到一项值为 1000000003时, 获取该 项为画笔宽度事件的标记; 当从绘画单元数组中读取到一项值为 1000000004 时, 获取该项为背景颜色事件的标记。 当从绘画单元数组中读取到一项值小 于 1000000000时, 获取该项为贝塞尔曲线线段的数据。
步骤 403: 接收方终端设备根据绘画事件的标记、 绘画事件的数据和贝 塞尔曲线线段的数据绘制手写内容。
在本步骤中, 可以包括如下过程。
第一步, 根据原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手 写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横 坐标和原始手写内容的最大纵坐标, 获取缩放参数。
以 "zoomsize" 表示缩放参数, 第一步的具体方法可以包括: 首先定义 缩放参数, 例如: zoomsize=1.0。 然后, 才艮据原始画纸尺寸或原始手写内容尺 寸与展示屏幕尺寸或布局尺寸的关系, 确定新的缩放参数值。 该缩放参数的 值必须大于 0, 没有上限要求。
在此基础上, 还可以定义播放速度参数。 该播放速度参数为执行该手写 内容展示方法的线程或进程的休眠时间。 以 "sleepTime" 表示该速度参数, 定义播放速度参数的一个具体实施方式为: sleepTime=60*zoomsize (毫秒)。并 且, 可以根据用户的设置, 随时更新该播放速度参数的值。 该播放速度参数 的值必须大于等于 0, 没有上限要求。 通过播放速度参数的设置, 可以调整 绘制贝塞尔曲线线段的速度, 从而能够产生动画效果, 按照书写顺序动态展 示手写内容, 将书写过程展现给接收方的用户。 当该播放速度参数的值为 0 时, 将不体现动画过程, 直接展示最后结果。
第二步, 根据缩放参数、 绘画事件的标记、 绘画事件的数据和贝塞尔曲 线线段的数据绘制手写内容。
第二步的具体绘制方法包括: 根据画笔颜色事件的标记以及画笔颜色事 件的数据, 设置画笔颜色; 根据画笔宽度事件的标记以及画笔宽度事件的数 据, 设置画笔宽度; 根据背景颜色事件的标记以及背景颜色事件的数据, 设 置背景颜色; 根据起始点事件的标记、 起始点事件的数据以及缩放参数, 绘 制起始点; 根据终止点事件的标记、 终止点事件的数据以及缩放参数, 绘制 终止点; 根据贝塞尔曲线线段的数据以及缩放参数, 绘制贝塞尔曲线。
具体地, 仍以本发明实施例二中的较佳的实施例为例, 定义当前读取位 置 i=0, 开始读取 DU[i] , 直到 i大于等于 DU数组长度的时候为止。
当读取到 DU[i]的值为 1000000000时, 说明获取到起始点事件的标记, 则 首先重置路径; 然后读取 x=DU[i+l]和 y=DU[i+2]; 再画点 (x*zoomsize,y*zoomsize); 然后采用下述语句将该点放入路径 path moveTo(x*zoomsize,y*zoomsize); 最后将当前读取位置在 DU 中向后移动 3 项, 即1^+3。
当读取到 DU[i]的值为 1000000001时, 说明获取到终止点事件的标记, 则读取 x=DU[i+l]和 y=DU[i+2] ; 然后画点(x*zoomsize,y*zoomsize); 然后采 用下述语句将该点放入路径: path lineTo(x*zoomsize,y*zoomsize); 然后画该 路径; 再重置 path; 最后将当前读取位置在 DU中向后移动 3项, 即 i=i+3。
当读取到 DU[i]的值为 1000000002时,说明获取到画笔颜色事件的标记, 则从当前位置的下一项读取画笔颜色: newcolor = DU[i+l] ; 然后将画笔颜色 设置为读取到的数值表示的 RGB 参数对应的颜色; 最后将当前读取位置在 DU中向后移动 2项, 即 i=i+2。 当读取到 DU[i]的值为 1000000003时,说明获取到画笔宽度事件的标记, 则从当前位置的下一项读取画笔宽度: newwidth = DU[i+l] ; 然后将画笔宽度 设置为读取到的数值与缩放参数的乘积对应的像素; 最后将当前读取位置在 DU中向后移动 2项, 即 i=i+2。
当读取到 DU[i]的值为 1000000004时,说明获取到背景颜色事件的标记, 则从当前位置的下一项读取背景颜色: newcolor = DU[i+l] ; 然后将背景颜色 设置为读取到的数值表示的 RGB 参数对应的颜色; 最后将当前读取位置在 DU中向后移动 2项, 即 i=i+2。
当读取到 DU[i]的值小于 1000000000时, 说明获取到贝塞尔曲线线段的 数据, 则从当前位置向前两项读取前一点的坐标并从当前位置向后两项读取 后一点的坐标, 即: Xl=DU[i-2], Yl=DU[i-l], X2=DU[i], Y2=DU[i+l] ; 然后, 以(XI * zoomsize, Yl * zoomsize)为起始点, 以((X1+X2) /2)*zoomsize, ((Y1+Y2) 12) *zoomsize)为终止点,画贝塞尔曲线;最后将当前读取位置在 DU 中向后移动 4项, 即 i=i+4。
在上述方案的基础上, 进一步地, 在绘制手写内容时, 当从绘画单元数 组读取的当前项不属于绘画事件的标记或贝塞尔曲线线段的数据时, 继续读 取所述绘画单元数组的下一项。
具体地, 仍以本发明实施例二中的较佳的实施例为例, 当读取到 DU[i] 的值大于 1000000004时, 说明当前获取到的既不是画笔颜色事件的标记、 画 笔宽度事件的标记、 背景颜色事件的标记、 起始点事件的标记或终止点事件 的标记, 也不是贝塞尔曲线线段的数据, 即当前项不属于绘画事件的标记或 贝塞尔曲线线段的数据时, 则继续读取绘画单元数组的下一项, 即: Number= DU[i+l] ; i=i+l+ Number。 通过此步骤, 实现面向未来的扩展, 如果在手写 内容展示方法中增加新的事件, 则可以增加一个参数, 该参数以 "Number" 为例, 该参数用以说明新增加的事件的标记需要占用的 DU中的项数, 如果 当前采用的手写内容展示方法无法解析该新增加的事件, 则可以只读出该
Number参数, 然后跳过当前读取的项, 继续读取绘画单元数组的下一项。
在本发明实施例四中, 通过对二进制文件或二进制码流的解析, 从其中 的数组中读取手写内容的绘画事件和贝塞尔曲线线段的数据, 根据该事件和 数据绘制手写内容展示给用户, 由于携带相同手写内容的数组构成的二进制 文件或二进制码流所占的存储空间明显小于图片所占的存储空间, 因此可以 节约磁盘空间, 并且在传输时可以节省大量的网络流量。 并且, 通过在绘制 贝塞尔曲线线段时设置播放速度参数, 能够调整绘制速度, 从而产生动画效 果, 按照书写顺序动态展示手写内容, 将书写过程展现给接收方的用户。
图 5为本发明实施例五的终端设备的结构示意图。 如图 5所示, 该设备 至少包括: 手写内容处理单元 51、 数组处理单元 52和文件处理单元 53。
其中, 手写内容处理单元 51用于获取手写内容对应的绘画事件、 绘画曲 线线段、 用户信息和原始绘画尺寸信息。 在本发明一种较佳的实施方式中, 该绘画曲线线段具体可以采用贝塞尔曲线线段。
数组处理单元 52用于将上述绘画事件的标记、上述绘画事件的数据和上 述绘画曲线线段的数据存储到绘画单元数组, 绘画事件的标记用于指示绘画 事件的类型, 绘画事件的数据为绘画事件的内容对应的具体数值。
文件处理单元 53用于生成并存储二进制文件。 上述二进制文件包括: 上 述用户信息、 上述原始绘画尺寸信息和上述绘画单元数组。
在上述技术方案的基础上, 具体地, 上述绘画事件包括: 画笔颜色事件、 画笔宽度事件、 背景颜色事件、 起始点事件和终止点事件。 上述用户信息包 括: 用户身份标识 ID的长度信息和用户 ID数组。 上述原始绘画尺寸信息包 括: 原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内容的最小 横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标和原始手 写内容的最大纵坐标。
在上述技术方案的基础上, 进一步地, 该设备中还可以包括第一发送单 元 54。 该第一发送单元 54用于向接收方终端设备发送手写消息报文。 上述 手写消息报文中携带上述二进制文件的消息类型标识和上述二进制文件。
在上述技术方案的基础上, 进一步地, 该设备中还可以包括第二发送单 元 55。 该第二发送单元 55用于向接收方终端设备发送共享白板消息报文。 上述共享白板消息报文中携带二进制码流的消息类型标识和上述二进制码 流, 上述二进制码流包括上述原始绘画尺寸信息和上述绘画单元数组。
在本发明实施例五中, 手写内容处理单元从手写内容中提取出绘画事件 和绘画曲线线段的数据, 数组处理单元将上述事件和数据记录到数组中, 、 文件处理单元根据该数组生成二进制文件并存储, 与现有的采用图片文件存 储手写内容的方式相比, 由于携带相同手写内容的数组构成的二进制文件所 占的存储空间明显小于图片所占的存储空间, 因此可以节约磁盘空间。 并且, 采用上述设备存储手写内容, 在需要将该存储的内容发送到接收方时, 可以 节省大量的网络流量。
图 6为本发明实施例六的终端设备的结构示意图。 如图 6所示, 该设备 至少包括: 信息接收单元 61、 数据读取单元 62和绘画单元 63。
其中,信息接收单元 61用于获取原始绘画尺寸信息和绘画单元 63数组。 数据读取单元 62用于从上述绘画单元 63数组中读取手写内容对应的绘 画事件的标记、 上述绘画事件的数据和上述手写内容对应的绘画曲线线段的 数据, 绘画事件的标记用于指示绘画事件的类型, 绘画事件的数据为绘画事 件的内容对应的具体数值。 在本发明一种较佳的实施方式中, 该绘画曲线线 段具体可以采用贝塞尔曲线线段。
绘画单元 63用于根据上述绘画事件的标记、上述绘画事件的数据和上述 绘画曲线线段的数据绘制上述手写内容。
在上述技术方案的基础上, 具体地, 上述原始绘画尺寸信息包括: 原始 画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标和原始手写内容的 最大纵坐标。 上述绘画事件包括: 画笔颜色事件、 画笔宽度事件、 背景颜色 事件、 起始点事件和终止点事件。
在上述技术方案的基础上, 具体地, 上述绘画单元 63具体用于根据上述 原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内容的最小横坐 标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标和原始手写内 容的最大纵坐标, 获取缩放参数; 根据上述画笔颜色事件的标记以及画笔颜 色事件的数据, 设置画笔颜色; 根据上述画笔宽度事件的标记以及画笔宽度 事件的数据, 设置画笔宽度; 根据上述背景颜色事件的标记以及背景颜色事 件的数据, 设置背景颜色; 根据上述起始点事件的标记、 起始点事件的数据 以及上述缩放参数, 绘制起始点; 根据上述终止点事件的标记、 终止点事件 的数据以及上述缩放参数, 绘制终止点; 根据上述绘画曲线线段的数据以及 上述缩放参数, 绘制绘画曲线。
在上述技术方案的基础上, 进一步地, 上述绘画单元 63还具体用于在从 上述绘画单元 63 数组读取的当前项不属于上述绘画事件的标记和上述绘画 曲线线段的数据时, 继续读取上述绘画单元 63数组的下一项。
在上述技术方案的基础上, 具体地, 上述信息接收单元 61具体用于从发 送方终端设备接收手写消息报文, 上述手写消息报文中携带二进制文件的消 息类型标识和上述二进制文件, 上述二进制文件包括: 用户信息、 上述原始 绘画尺寸信息和上述绘画单元 63数组,上述用户信息包括:用户身份标识 ID 的长度信息和用户 ID数组。
或者,上述信息接收单元 61具体用于从发送方终端设备接收共享白板消 息报文, 上述共享白板消息报文中携带二进制码流的消息类型标识和上述二 进制码流, 上述二进制码流包括原始绘画尺寸信息和上述绘画单元 63数组。
在本发明实施例六中, 根据信息接收单元获取的原始绘画尺寸信息和绘 画单元数组, 数据读取单元从该文件的数组中读取手写内容的绘画事件和绘 画曲线线段的数据, 绘画单元根据该事件和数据绘制手写内容展示给用户, 与现有的采用图片文件展示手写内容的方式相比, 携带相同手写内容的数组 所占的存储空间明显小于图片所占的存储空间, 因此可以节约磁盘空间, 并 且在传输时可以节省大量的网络流量。 发明实施例一和本发明实施例二的记载, 本发明实施例六的终端设备的各个 组成单元的具体执行方式可以参照本发明实施例三和本发明实施例四的记 六的终端设备的各个组成单元可以同时设置与同一个终端设备中。
需要说明的是: 对于前述的各方法实施例, 为了筒单描述, 故将其都表 述为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不受所描 述的动作顺序的限制, 因为依据本发明, 某些步骤可以采用其他顺序或者同 时进行。 其次, 本领域技术人员也应该知悉, 说明书中所描述的实施例均属 于优选实施例, 所涉及的动作和模块并不一定是本发明所必须的。
在上述实施例中, 对各个实施例的描述都各有侧重, 某个实施例中没有 详述的部分, 可以参见其他实施例的相关描述。
本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算机可 读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的步骤; 而 前述的存储介质包括: ROM, RAM, 磁碟或者光盘等各种可以存储程序代码 的介质。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并 不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求 书
1、 一种触摸屏手写内容的存储方法, 其特征在于, 包括:
获取手写内容对应的绘画事件、 绘画曲线线段、 用户信息和原始绘画尺 寸信息;
将所述绘画事件的标记、 所述绘画事件的数据和所述绘画曲线线段的数 据存储到绘画单元数组,所述绘画事件的标记用于指示所述绘画事件的类型, 所述绘画事件的数据为所述绘画事件的内容对应的具体数值;
生成并存储二进制文件, 所述二进制文件包括: 所述用户信息、 所述原 始绘画尺寸信息和所述绘画单元数组。
2、 根据权利要求 1所述的方法, 其特征在于,
所述绘画事件包括: 画笔颜色事件、 画笔宽度事件、 背景颜色事件、 起 始点事件和终止点事件;
所述用户信息包括: 用户身份标识 ID的长度信息和用户 ID数组; 所述原始绘画尺寸信息包括: 原始画纸的最大横坐标、 原始画纸的最大 纵坐标、 原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手 写内容的最大横坐标和原始手写内容的最大纵坐标。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述生成并存储二进 制文件之后, 还包括:
向接收方终端设备发送手写消息报文, 所述手写消息报文中携带所述二 进制文件的消息类型标识和所述二进制文件。
4、 根据权利要求 1或 2所述的方法, 其特征在于, 所述将所述绘画事件 的标记、 所述绘画事件的数据和所述绘画曲线线段的数据存储到绘画单元数 组之后, 还包括:
向接收方终端设备发送共享白板消息报文, 所述共享白板消息报文中携 带二进制码流的消息类型标识和所述二进制码流, 所述二进制码流包括所述 原始绘画尺寸信息和所述绘画单元数组。
5、 一种触摸屏手写内容的展示方法, 其特征在于, 包括:
获取原始绘画尺寸信息和绘画单元数组;
从所述绘画单元数组中读取手写内容对应的绘画事件的标记、 所述绘画 事件的数据和所述手写内容对应的绘画曲线线段的数据, 所述绘画事件的标 记用于指示所述绘画事件的类型, 所述绘画事件的数据为所述绘画事件的内 容对应的具体数值;
根据所述绘画事件的标记、 所述绘画事件的数据和所述绘画曲线线段的 数据绘制所述手写内容。
6、 根据权利要求 5所述的方法, 其特征在于,
所述原始绘画尺寸信息包括: 原始画纸的最大横坐标、 原始画纸的最大 纵坐标、 原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手 写内容的最大横坐标和原始手写内容的最大纵坐标;
所述绘画事件包括: 画笔颜色事件、 画笔宽度事件、 背景颜色事件、 起 始点事件和终止点事件。
7、 根据权利要求 6所述的方法, 其特征在于, 所述根据所述绘画事件的 标记、 所述绘画事件的数据和所述绘画曲线线段的数据绘制所述手写内容包 括:
根据所述原始画纸的最大横坐标、 原始画纸的最大纵坐标、 原始手写内 容的最小横坐标、 原始手写内容的最小纵坐标、 原始手写内容的最大横坐标 和原始手写内容的最大纵坐标, 获取缩放参数;
根据所述画笔颜色事件的标记以及画笔颜色事件的数据,设置画笔颜色; 根据所述画笔宽度事件的标记以及画笔宽度事件的数据,设置画笔宽度; 根据所述背景颜色事件的标记以及背景颜色事件的数据,设置背景颜色; 根据所述起始点事件的标记、 起始点事件的数据以及所述缩放参数, 绘 制起始点;
根据所述终止点事件的标记、 终止点事件的数据以及所述缩放参数, 绘 制终止点;
根据所述绘画曲线线段的数据以及所述缩放参数, 绘制绘画曲线。
8、 根据权利要求 7所述的方法, 其特征在于, 所述根据所述绘画事件的 标记、 所述绘画事件的数据和所述绘画曲线线段的数据绘制所述手写内容还 包括:
当从所述绘画单元数组读取的当前项不属于所述绘画事件的标记和所述 绘画曲线线段的数据时, 继续读取所述绘画单元数组的下一项。
9、 根据权利要求 5至 8所述的方法, 其特征在于, 所述获取原始绘画尺 寸信息和绘画单元数组包括:
从发送方终端设备接收手写消息报文, 所述手写消息报文中携带二进制 文件的消息类型标识和所述二进制文件, 所述二进制文件包括: 用户信息、 所述原始绘画尺寸信息和所述绘画单元数组, 所述用户信息包括: 用户身份 标识 ID的长度信息和用户 ID数组;
或, 从发送方终端设备接收共享白板消息报文, 所述共享白板消息报文 中携带二进制码流的消息类型标识和所述二进制码流, 所述二进制码流包括 原始绘画尺寸信息和所述绘画单元数组。
10、 一种终端设备, 其特征在于, 包括:
手写内容处理单元, 用于获取手写内容对应的绘画事件、绘画曲线线段、 用户信息和原始绘画尺寸信息;
数组处理单元, 用于将所述绘画事件的标记、 所述绘画事件的数据和所 述绘画曲线线段的数据存储到绘画单元数组, 所述绘画事件的标记用于指示 所述绘画事件的类型, 所述绘画事件的数据为所述绘画事件的内容对应的具 体数值;
文件处理单元, 用于生成并存储二进制文件, 所述二进制文件包括: 所 述用户信息、 所述原始绘画尺寸信息和所述绘画单元数组。
11、 根据权利要求 10所述的设备, 其特征在于,
所述绘画事件包括: 画笔颜色事件、 画笔宽度事件、 背景颜色事件、 起 始点事件和终止点事件;
所述用户信息包括: 用户身份标识 ID的长度信息和用户 ID数组; 所述原始绘画尺寸信息包括: 原始画纸的最大横坐标、 原始画纸的最大 纵坐标、 原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手 写内容的最大横坐标和原始手写内容的最大纵坐标。
12、 根据权利要求 10或 11所述的设备, 其特征在于, 还包括: 第一发送单元, 用于向接收方终端设备发送手写消息报文, 所述手写消 息 ·^艮文中携带所述二进制文件的消息类型标识和所述二进制文件。
13、 根据权利要求 10或 11所述的设备, 其特征在于, 还包括: 第二发送单元, 用于向接收方终端设备发送共享白板消息报文, 所述共 享白板消息报文中携带二进制码流的消息类型标识和所述二进制码流, 所述 二进制码流包括所述原始绘画尺寸信息和所述绘画单元数组。
14、 一种终端设备, 其特征在于, 包括:
信息接收单元, 用于获取原始绘画尺寸信息和绘画单元数组;
数据读取单元, 用于从所述绘画单元数组中读取手写内容对应的绘画事 件的标记、所述绘画事件的数据和所述手写内容对应的绘画曲线线段的数据, 所述绘画事件的标记用于指示所述绘画事件的类型, 所述绘画事件的数据为 所述绘画事件的内容对应的具体数值;
绘画单元, 用于根据所述绘画事件的标记、 所述绘画事件的数据和所述 绘画曲线线段的数据绘制所述手写内容。
15、 根据权利要求 14所述的设备, 其特征在于,
所述原始绘画尺寸信息包括: 原始画纸的最大横坐标、 原始画纸的最大 纵坐标、 原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始手 写内容的最大横坐标和原始手写内容的最大纵坐标;
所述绘画事件包括: 画笔颜色事件、 画笔宽度事件、 背景颜色事件、 起 始点事件和终止点事件。
16、 根据权利要求 15所述的设备, 其特征在于,
所述绘画单元具体用于根据所述原始画纸的最大横坐标、 原始画纸的最 大纵坐标、 原始手写内容的最小横坐标、 原始手写内容的最小纵坐标、 原始 手写内容的最大横坐标和原始手写内容的最大纵坐标, 获取缩放参数; 根据 所述画笔颜色事件的标记以及画笔颜色事件的数据, 设置画笔颜色; 根据所 述画笔宽度事件的标记以及画笔宽度事件的数据, 设置画笔宽度; 根据所述 背景颜色事件的标记以及背景颜色事件的数据, 设置背景颜色; 根据所述起 始点事件的标记、 起始点事件的数据以及所述缩放参数, 绘制起始点; 根据 所述终止点事件的标记、 终止点事件的数据以及所述缩放参数, 绘制终止点; 根据所述绘画曲线线段的数据以及所述缩放参数, 绘制绘画曲线。
17、 根据权利要求 16所述的设备, 其特征在于,
所述绘画单元还具体用于在从所述绘画单元数组读取的当前项不属于所 述绘画事件的标记和所述绘画曲线线段的数据时, 继续读取所述绘画单元数 组的下一项。
18、 根据权利要求 14至 17所述的方法, 其特征在于, 所述信息接收单元具体用于从发送方终端设备接收手写消息报文, 所述 手写消息报文中携带二进制文件的消息类型标识和所述二进制文件, 所述二 进制文件包括: 用户信息、 所述原始绘画尺寸信息和所述绘画单元数组, 所 述用户信息包括: 用户身份标识 ID的长度信息和用户 ID数组;
或, 所述信息接收单元具体用于从发送方终端设备接收共享白板消息报 文, 所述共享白板消息报文中携带二进制码流的消息类型标识和所述二进制 码流, 所述二进制码流包括原始绘画尺寸信息和所述绘画单元数组。
PCT/CN2013/073330 2012-03-28 2013-03-28 触摸屏手写内容的存储方法、展示方法和终端设备 WO2013143471A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210085652.0A CN102663667B (zh) 2012-03-28 2012-03-28 触摸屏手写内容的存储方法、展示方法和终端设备
CN201210085652.0 2012-03-28

Publications (1)

Publication Number Publication Date
WO2013143471A1 true WO2013143471A1 (zh) 2013-10-03

Family

ID=46773146

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/073330 WO2013143471A1 (zh) 2012-03-28 2013-03-28 触摸屏手写内容的存储方法、展示方法和终端设备

Country Status (2)

Country Link
CN (1) CN102663667B (zh)
WO (1) WO2013143471A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663667B (zh) * 2012-03-28 2014-12-24 华为技术有限公司 触摸屏手写内容的存储方法、展示方法和终端设备
CN106468965A (zh) * 2015-08-14 2017-03-01 北大方正集团有限公司 笔形信息的存储方法及系统、笔形信息的回放方法及系统
CN106375300B (zh) * 2016-08-30 2019-07-09 孙卓金 手写笔画的网络会话传输方法
CN110806828B (zh) * 2018-08-02 2023-11-07 珠海金山办公软件有限公司 一种擦除pdf文档内容的方法和装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1811773A (zh) * 2005-01-21 2006-08-02 微软公司 以串行二进制格式存储文档的系统和方法
CN101295217A (zh) * 2008-06-05 2008-10-29 中兴通讯股份有限公司 手写输入处理装置和方法
CN102663667A (zh) * 2012-03-28 2012-09-12 华为技术有限公司 触摸屏手写内容的存储方法、展示方法和终端设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7385595B2 (en) * 2001-11-30 2008-06-10 Anoto Ab Electronic pen and method for recording of handwritten information
CN100380907C (zh) * 2003-04-18 2008-04-09 张烂熳 一种使通信终端实现手写笔迹信息交流的方法
CN100590646C (zh) * 2004-09-21 2010-02-17 北京优士东方数码科技有限公司 手写即时消息实现方法
CN101567894A (zh) * 2009-05-31 2009-10-28 方亚南 手写信息发送/接收方法及发送/接收装置
CN101656548A (zh) * 2009-08-04 2010-02-24 中兴通讯股份有限公司 一种实现近距离通信语音播报功能的无线终端及方法
CN102110175A (zh) * 2009-12-29 2011-06-29 鸿富锦精密工业(深圳)有限公司 保存输入字符的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1811773A (zh) * 2005-01-21 2006-08-02 微软公司 以串行二进制格式存储文档的系统和方法
CN101295217A (zh) * 2008-06-05 2008-10-29 中兴通讯股份有限公司 手写输入处理装置和方法
CN102663667A (zh) * 2012-03-28 2012-09-12 华为技术有限公司 触摸屏手写内容的存储方法、展示方法和终端设备

Also Published As

Publication number Publication date
CN102663667A (zh) 2012-09-12
CN102663667B (zh) 2014-12-24

Similar Documents

Publication Publication Date Title
CN1819648B (zh) 处理视频效果的方法和系统
US10496354B2 (en) Terminal device, screen sharing method, and screen sharing system
US20060148527A1 (en) Mobile graphics device and server
TWI299464B (zh)
CN112073754B (zh) 一种云游戏投屏方法、装置、计算机设备、计算机可读存储介质及云游戏投屏交互系统
US20170034173A1 (en) System for Sharing Selectively Ephemeral Content
WO2016192457A1 (zh) Ar图书及基于ar图书的索引式增强现实系统和方法
CN112073758A (zh) 一种云桌面投屏方法、装置、计算机设备、计算机可读存储介质及云桌面投屏交互系统
US9514718B2 (en) Information processing system, information processing apparatus, and information processing method
KR20130072642A (ko) 휴대용 단말기에서 메시지의 첨부 파일을 관리하기 위한 장치 및 방법
JP2016045831A (ja) 端末装置、画面共有方法、プログラム及び画面共有システム
WO2013143471A1 (zh) 触摸屏手写内容的存储方法、展示方法和终端设备
WO2014114084A1 (zh) 多媒体信息发送、接收、传输方法及卡片发送、接收终端
JP2013118612A (ja) 移動通信端末の画面キャプチャー方法
CN109862381A (zh) 基于动态视频海报的推广方法、系统、装置和存储介质
US20160080297A1 (en) Method for exchanging multimedia messages
US20150150105A1 (en) Communication management apparatus, program, communication management method, and communication management system
WO2016078454A1 (zh) 一种动态头像的实现方法及装置
JP2016110253A (ja) 情報処理システム、情報処理装置、情報提供方法及びプログラム
CN205281405U (zh) 一种基于增强现实的图像识别系统
CN110661880A (zh) 一种远程协助方法、系统和存储介质
WO2023273905A1 (zh) 信息同屏方法、发送端、接收端及计算机可读存储介质
WO2011137673A1 (zh) 一种信息合成方法、及对应的终端和即时通讯系统
CN105677362B (zh) 一种图像绘制方法及其系统
JP2016099773A (ja) 端末装置、再生方法、プログラム及び画面共有システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13770067

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13770067

Country of ref document: EP

Kind code of ref document: A1