Вниз
Скачать: 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.023 c
1-1082034740
DimonNew
2004-04-15 17:12
2004.05.02
Изменить название листа Excel


1-1081857431
Liona
2004-04-13 15:57
2004.05.02
Какой тип у TMemo?


14-1081106133
juiceman
2004-04-04 23:15
2004.05.02
перехват вызовов win-api функций


7-1078480939
User_OKA
2004-03-05 13:02
2004.05.02
Разделитель


14-1081362951
VID
2004-04-07 22:35
2004.05.02
В какой момент Windows даёт команду сбросить кеш винта на диски ?




   Наверх