Home > Back-end >  Excuse me useful RXRichEdit?? How to solve the RxRichEdit1 after loading the images. The text only a
Excuse me useful RXRichEdit?? How to solve the RxRichEdit1 after loading the images. The text only a

Time:10-13

I am now in to write a network chat program, to achieve the function of a sending pictures, I use method is to convert image to RTF format characters,
Concrete implementation method is
Rxrichedit1. Seltext:=bmptortf (BMP);
Rxrichedit1. Sellength:=0;
Rxrichedit1. Selstart:=rxrichedit1. Selstart + 1;
. I found that after a breakpoint tracing rxrichexit1 text or rxrichedit1. Seltext can display the edit box, such as the content of the properties of the load the image () has been loaded successfully, only out of a space,,,,,,,
. I want to now is how to make the text more an RTF code (that is, bmptortf () function returns the string value), then send to others, the other side of the rxrichedit control add this code will display
Or use other ways to make me to know when to send the rxrichedit what to load the picture above, if because now. The text property only a space more words I am unable to know what the image is what of,
Urgent for solution!!!!!!!!!!! I in baidu Google search on it for a long time didn't answer!!!!!! Or is this control can only be like this?? That can recommend other can support by mixed control?? I already gave 100 points!! Solving!!!!!

CodePudding user response:

I use Trichedit tried to insert pictures, add [{/rtf1 {/Pict/dibitmap? string

CodePudding user response:

reference 1st floor simonhehe response:
I use Trichedit tried to insert pictures, add [{/rtf1 {/Pict/dibitmap? String


Please can you explain in detail, what I use is rxrichedit controls, with BmpToRtf () function returns will add the string, but inside the text property will not display

CodePudding user response:

refer to the second floor LCPDtiger response:
reference 1st floor simonhehe response: I use Trichedit tried to insert pictures, add [{/rtf1 {/Pict/dibitmap? String

Please can you explain in detail, what I use is rxrichedit controls, with BmpToRtf () function returns will add the string, but inside the text property will not display


An estimated rxrichedit find it, I test code below
 USES 
JPEG, Clipbrd;

{$R *. DFM}
The function BMPToRTF (const Bitmap: TBitmap) : string;
Var
Bi, bb: string;
The bis, BBS: the Cardinal;
Achar: string [2];
Buffer: string;
I: Integer;
Type
PWord=^ Word;
The begin
GetDIBSizes (Bitmap Handle, the bis, BBS);
SetLength (bi, bis);
SetLength (bb, BBS);
GetDIB (Bitmap Handle, the Bitmap. The Palette, PChar (bi) ^, PChar (bb) ^);
SetLength (Buffer, (Length (bb) + Length (bi)) * 2);
I:=1;
For the bis:=1 to Length (bi) do
The begin
Achar:=IntToHex (Integer (bi [bis]), 2);
PWord (@ Buffer [I]) ^ :=PWord (@ achar [1]) ^;
Inc (I, 2);
The end;
For BBS:=1 to Length (bb) do
The begin
Achar:=IntToHex (Integer (bb (BBS)), 2);
PWord (@ Buffer [I]) ^ :=PWord (@ achar [1]) ^;
Inc (I, 2);
The end;
Result:='{/rtf1 {/Pict dibitmap' + Buffer + '}} ';
ShowMessage (inttostr (length (Result)));
The end;

Procedure TForm13. Btn1Click (Sender: TObject);
The begin
Redt1. Seltext:=BMPToRTF (img1. Picture. Bitmap);
Redt1. Sellength:=0;
Redt1. Selstart:=redt1. Selstart + 1;
The end;

CodePudding user response:

reference simonhehe reply: 3/f
refer to the second floor LCPDtiger response: refer to 1st floor simonhehe response: I use Trichedit tried to insert pictures, add [{/rtf1 {/Pict/dibitmap? String

Please can you explain in detail, what I use is rxrichedit controls, with BmpToRtf () function returns will add the string, but inside the text property will not display

Estimates have to find rxric...

I am using this function
That you had redt1 breakpoint after test the code tracking. The value of the text? A space was just too much? The?

CodePudding user response:

LCPDtiger
reference 4 floor response:
reference simonhehe reply: 3/f reference LCPDtiger reply 2 floor: refer to 1st floor simonhehe response: I use Trichedit tried to insert pictures, add [{/rtf1 {/Pict/dibitmap? String

Please can you explain in detail, what I use is rxrichedit controls, with BmpToRtf () function returns will add the string, but the text property...

Result:='{/rtf1 {/Pict dibitmap' + Buffer + '}} ';

The value of the Result

CodePudding user response:

reference 5 floor simonhehe reply:
reference 4 floor LCPDtiger response: refer to 3rd floor simonhehe response: refer to the second floor LCPDtiger response: refer to 1st floor simonhehe response: I use Trichedit tried to insert pictures, add [{/rtf1 {/Pict/dibitmap? String

Please can you explain in detail, what I use is rxrichedit controls, with BmpToRtf () function returns...
are you?? Version might be the problem,,, can you tell me is rxlib which version are you using? .

CodePudding user response:

The building Lord, please the problem solved?
I also have the same confusion
I want to insert a picture, without a newline: behind the images to append to a text, seems can't find ways to implement
If you want to join by mixed content, more can't achieve

CodePudding user response:

  • Related