Article View: borland.public.cppbuilder.nativeapi
Article #5892Re: TRichEdit
From: Mark Jacobs
Date: Thu, 23 Jun 2005 10:29
Date: Thu, 23 Jun 2005 10:29
21 lines
1863 bytes
1863 bytes
Robert G. Hoover wrote:
> I've been experimenting with TRichEdit and have been able to load the
> contents of an external file into the object for display. My question
> is.... as RTF supports images inline with my text, does TRichEdit
> support images as well?
This is the quickest and easiest way of embedding an image in your raw RTF file :-
int ii; FILE *fp=fopen(OpenPictureDialog1->FileName.c_str(),"rb"); if (!fp)
return;
AnsiString picimg=""; while (!feof(fp)) { ii=fgetc(fp); if (ii!=EOF)
picimg+=IntToHex(ii,2);}
fclose(fp); picimg="\r\n{\\pict \\jpegblip\r\n"+picimg+"}\r\n\\par";
Then, you write out the first bit of the RTF, then you wirte the code in
picimg, then the rest of the RTF file. As you can see, you have to handle the
raw RTF codings yourself. BTW the jpegblip tag works with all image types.
--
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID:
<42ba8eb8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42b05f1b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c3ccfacf8c2ecf6f X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 23 Jun 2005 11:29:08 +0100 From: Mark Jacobs <http://www.jacobsm.com/mjmsg.htm?mj@critical> User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: TRichEdit References: <42b05f1b$1@newsgroups.borland.com> In-Reply-To: <42b05f1b$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.144.157.8 Message-ID: <42ba8eb8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1119522488 81.144.157.8 (23 Jun 2005 03:28:08 -0700) Lines: 21 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail