Вниз
Скачать: CL | DM;

RxRichEdit   Найти похожие ветки 

← →
Yegorchic   (2004-04-17 01:17) [0]

Здрасте все! Не подскажет ли кто, как программно в RxRichEdit"e вставить картинку?
Заренее спасибо!


← →
Yanis ©   (2004-04-17 01:58) [1]

Размести на форме image с картинкой(TBitmap).
Далее:

procedure TForm1.Button2Click(Sender: TObject);
function BitmapToRTF(pict: TBitmap): string;
var
 bi,bb,rtf: string;
 bis,bbs: Cardinal;
 achar: ShortString;
 hexpict: string;
 I: Integer;
begin
 GetDIBSizes(pict.Handle,bis,bbs);
 SetLength(bi,bis);
 SetLength(bb,bbs);
 GetDIB(pict.Handle,pict.Palette,PChar(bi)^,PChar(bb)^);
 rtf := "{\rtf1 {\pict\dibitmap ";
 SetLength(hexpict,(Length(bb) + Length(bi)) * 2);
 I := 2;
 for bis := 1 to Length(bi) do
 begin
   achar := Format("%x",[Integer(bi[bis])]);
   if Length(achar) = 1 then
     achar := "0" + achar;
   hexpict[I-1] := achar[1];
   hexpict[I] := achar[2];
   Inc(I,2);
 end;
 for bbs := 1 to Length(bb) do
 begin
   achar := Format("%x",[Integer(bb[bbs])]);
   if Length(achar) = 1 then
     achar := "0" + achar;
   hexpict[I-1] := achar[1];
   hexpict[I] := achar[2];
   Inc(I,2);
 end;
 rtf := rtf + hexpict + " }}";
 Result := rtf;
end;
var
 ss:TStringStream;
begin
 SS := TStringStream.Create(BitmapToRTF(Image1.Picture.Bitmap));
 RE.PlainText := False;
 RE.StreamMode := [smSelection];
 RE.Lines.LoadFromStream(SS);
 SS.Free;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.024 c
14-1081346341
}|{yk
2004-04-07 17:59
2004.05.02
Загрузчик данных


7-1078829050
Sergey Andropov
2004-03-09 13:44
2004.05.02
Своя ОС


1-1082024160
gauss
2004-04-15 14:16
2004.05.02
Подскажите Зачем применяется конструкция приведенная ниже


14-1080857843
VID
2004-04-02 02:17
2004.05.02
Купил комп...


6-1078042857
Ozone
2004-02-29 11:20
2004.05.02
TCP/IP




   Наверх