|
|||
|
Hello
i'm trying to make a RTF generator and got a problem on how to put image in rtf.. i learned that image in RTF files were written in hex16 i've found a code to convert string into hex16.. but my problem is, how do I convert the image data into string so that i can convert it to hex16? ![]() above is the example of a PNG file when i open it using Notepad++ and convert it to Hex16 when using this codes in SWFkit.. : a = "HP.png" var file = new FileStream(a, "r"); imageByte = file.readLine(a) ..imageByte only return ‰PNG (the text highlighted in green)... it's like the other data is missing, or perhaps unreadable? but if i'm using file.read(20480), which is the size of the image, and trace("[start]"+imageByte+"[end]"), imageByte only return ![]() without [end] so is there any proper way to obtain the image data either within SWFkit or AS2.0? |
|
|||
|
Please try the "StringStream.readFromFile(name)" method. The trace method cannot show the content of a binary file properly, because the binary file may contain zero, which means the end of a string.
If you still have any problem, please send a sample to our support email box. We'll be happy to help you solve it. |
|
|||
|
thanks..
sstream = StringStream.readFromFile("HP.png") now sstream.length is 20000++ compare to my 1st post which only return length 4 but when I try to view sstream in textfield, it still can't view full length, still the same as previous.. i guess it's because of end of string just like you said.. but it doesn't matter because i don't need to view the full length in text, as long as it store the correct (i hope so) length so that later i can convert it to hex16.. for that part, i'll try that later... thanks again |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|