如题,没代码,给个思路吧。

解决方案 »

  1.   

    恩,将每个表情和某个特殊字符对应起来,比如高兴的表情可以用[/:happy]表示,当对方接收到这个字符串时程序自动将其翻译成图片名字,然后从数据库或硬盘加载这个图片。 就是这样一个过程
      

  2.   

    建一个数据Table,可以是XML,也可以是Access格式的,然后建立两个字段,一个是描述,另一个是图片的内容。然后在输入字符的时间,当按回车时,就触发字母的配对查找,将相配的字符返回相对应的图片就可以了。 
      

  3.   

    其实也不算是自己完成的,只是模仿别人的代码,当然也复制了一些代码,
    在代码中有一个函数,由这个函数将Bitmap转换为RTF格式,function ConvertBitmapToRTF(const Bitmap: TBitmap): string;
    var
      bi, bb: string;
      bis, bbs: Cardinal;
      achar: string[2];
      Buffer: string;
      I: Integer;
    type
      PWord = ^Word;
    begin
      GetDIBSizes(Bitmap.Handle, bis, bbs);
      SetLength(bi, bis);
      SetLength(bb, bbs);
      GetDIB(Bitmap.Handle, Bitmap.Palette, PChar(bi)^, PChar(bb)^);
      SetLength(Buffer, (Length(bb) + Length(bi)) * 2);
      i := 1;
      for bis := 1 to Length(bi) do
      begin
        achar := IntToHex(Integer(bi[bis]), 2);
        PWord(@Buffer[i])^ := PWord(@achar[1])^;
        inc(i, 2);
      end;
      for bbs := 1 to Length(bb) do
      begin
        achar := IntToHex(Integer(bb[bbs]), 2);
        PWord(@Buffer[i])^ := PWord(@achar[1])^;
        inc(i, 2);
      end;
      Result := '{\rtf1 {\pict\dibitmap ' + Buffer + ' }}';
    end;