Tutorials to .com

Tutorials to .com » Dotnet » Winform » RTF expression in the image and expression of the code where the reciprocal

RTF expression in the image and expression of the code where the reciprocal

Print View , by: iSee ,Total views: 10 ,Word Count: 597 ,Date: Mon, 24 Aug 2009 Time: 4:10 AM

Posts made at the forum on how to insert a RTF inside a picture into a custom code for the expression

And reversible.


First of all thank those who recommend friends also like to thank me top friends. More urgent because of the time, the problem be solved. Now share with you.

I remember in the richtextbox insert pictures have N number of ways, in fact, only two ways to richtextbox, one is a pict at the beginning of the insert directly in the richtextbox, two kinds of object is a way of beginning to ole embedded. We discuss the former species are more due to the code, I directly download the code works for everyone. This is only to talk about some ideas to solve

RTF is not a sign can be used to identify a picture (currently not found J), it should turn into a face image code, and only in accordance with the image signature to locate the picture, but the 71 images to find its signature is too cumbersome So first find the smallest signature 71 images, for the sake of simplicity we have chosen the image is generated hex after N bytes before the election, this N can represent 71 different image. way to compare apples to apples (available selection sort Act) r to find the N. and then we generate the sequence of documents can be smile.bin, each picture contains a complete picture, pictures, signature, as well as representatives of the expression code for this picture.

Forward transformation: When you want to send a message containing the face image, because that contains pictures, this RTF is huge. We need to convert the code part of the image the expression of custom code, such as pictures as "^-^" - à " :). "

In the RTF inside the picture to pict at the beginning of this part of the code that we can remove and insert the expression of our custom code. Method is to identify the pict the first 500 bytes (500 is the N, I have here a picture) and smile.bin compare the signature in the picture, strangely enough, with a picture image generated code actually two somewhat different (and I richtextbox Gaoshimegui), so a vague reference factor, this factor of 28, a different picture may be different. After such a match can be found expression code.

Reverse transformation: expression of the code is to convert the image, that translated into more than being simple, as long as RTF where to find the expression of our custom code based smile.bin to find the corresponding image file, but here there is a problem, can not be directly expression shown in richtextbox insert the code before the rtf code, because that is not complete, would give an exception, must be complete, so that the transformation process must take to a richtextbox to be responsible for the transformation of images.

In fact, if RTF directly to our custom label, it should not be so troublesome. Richtextbox, but directly to the assignment, it will get rid of those it considers useless tags (bitter)

If you have a better way please let me know.

Results are as follows:

.Net Windows development Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.