Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.05.02;
Скачать: 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 вся ветка

Текущий архив: 2004.05.02;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.036 c
8-1075535510
alvar
2004-01-31 10:51
2004.05.02
Audio Grabber


7-1078989745
DuchmanSoft
2004-03-11 10:22
2004.05.02
Как убрать отображение чужего окна на панели задачь?


7-1078424981
Vik_Mix
2004-03-04 21:29
2004.05.02
LPT порт


1-1081820986
niko4543
2004-04-13 05:49
2004.05.02
Word


14-1081248405
Nikolay M.
2004-04-06 14:46
2004.05.02
Какую самую нестандартную должность вы занимали :)