Images into RTB, works on xp... not vista?

oXiDe

Member
Joined
Jun 24, 2009
Messages
12
Programming Experience
1-3
Hi All,

We are creating a Chat Application for our chatnetwork, we originally made it in VB6 works like a beauty and converting to VB.NET

At the moment, it joins the channel fine, nothing wrong with this displays everything it needs to however we are in the process of showing emoticons...

While we were on XP in debug mode and release mode, the emoticons showed... Once we moved the compiled version over to Vista Home and Ulitmate the emoticons would not show, we have looked and looked all over google and have not come to a conclusion, today we even moved the whole Project folder over to Vista, ran it in debug mode, and the images still wouldn't show in the RTB. Works fine in XP but not Vista?

Same version VS, same Framework, i'm confused?

Any help would be appreciated.


Thank you.
oXiDe
 
Images displays in Richtextbox on Vista Business and Vista Home, so other Vista versions should be the same. I don't know how you insert the images, but I used the 'Paste' trick :)
 
I did a bit more testing and I don't think the DLL is responsible...

At the moment, we are coverting it into a WMF, then into RTF then into the RTB

The string we receive is (data1.txt)

String is fine, no image...

I used the copy and paste method and received the exact same string (data1.txt)

Except with using the copy and paste method... The emoticon showed...

I'm a bit lost.. We recieve the same string, but emoticon doesn't show...
 

Attachments

  • data1.txt
    9.3 KB · Views: 10
  • data2.txt
    9.3 KB · Views: 13
Last edited by a moderator:
Problem with the Paste Method is it deletes the user's clipboard... We don't want that.. hmmm
The good practice in this case is to take what's there and put it back when you're done borrowing the users clipboard.
VB.NET:
Dim o As IDataObject = Clipboard.GetDataObject
'borrow clipboard
Clipboard.SetDataObject(o)
At the moment, we are coverting it into a WMF, then into RTF then into the RTB
...
I used the copy and paste method and received the exact same string
Are you sure it is the exact same? I also can load the image by setting the Rtf just fine. I noticed your string has upper case hex values, while the string produced by pasting the image has lower case hex. Did a test where I converted the hex data to upper and assigned Rtf, no problem with this also, the RTB just converts is to lower again when parsing the input data. Another difference is the string that is returned from Rtf property has linefeeds (not par's), but I can also confirm this don't affect the outcome. Apart from that I can't compare any differences, but you should make sure yours is.
 
I still prefer not to use the Paste method, but look's like i'm going to have to since I cannot work out why what we are currently doing is not working
 
Okay, so tried the paste thing out, it's not gonna work for what we need to do... (To Difficult to explain)

I'm back to my previous code I mentioned.. Why does it not work on Vista?
As mentioned.. we get the same string? so wtf?
 
As I said, are you sure the strings are the same, neither of the strings you posted is produced by RTB control. You should paste an image to the control and get the generated rtf codes from the controls Rtf property and compare with what you get from the library. If there is any difference you should look into it. As you also know you can take the Rtf generated when pasting the image and assign and empty RTB control and it will display the same image, so the error must be with the string produced by the library somehow. I can confirm the string you posted does not produce an image in RTB control, but I can't tell you why as I don't have the image that should produce that code in RTB control.
 
Back
Top