October 30, 2025, 05:21:19 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Richedit control

Started by GJ, May 05, 2011, 04:18:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GJ

How can i insert a picture (jpg) into a richedit control in EBasic ?
It was once stated in the changelog from version 1.70, but i lost a working sample of richedit.eba  :(

Anyone any ideas how to do this ??

Thanks in advance,


GJ

GJ

May 05, 2011, 03:59:57 PM #1 Last Edit: May 05, 2011, 04:02:17 PM by GJ
Seems Larry was looking for the same a time ago....  ;)
Although it is no jpg, it can do bmp.
As always... the search button is your friend......



http://www.ionicwind.com/forums/index.php?topic=3363.0

GWS

Hi GJ,

I've not found much use for a Rich Edit control - their main use I suppose is if you want your user to change text font and color, or to use paragraphing.  Almost a poor man's word processor.

But if that's the case - why not use Word or something which is built for the job.

A file can be saved as an .rtf and imported using @RTLOAD for display in a Rich Edit box - but to what end I'm not sure.

Anyway, I've played around with an example, and once you've opened a Rich Edit box, and maybe typed some text in it, you can import an image just by copying and pasting an existing  .bmp or .jpg at the cursor position.

Try it out using the RichEdit example program.  This allows you to save the file you've created as an .rtf file.

The snag is, whatever type of image you paste into the file, it is saved as a very large bitmap.  So the .rtf file created is huge (2 or 3 Mbytes).

Once you've got the file saved, you can @RTLOAD load it again into your program and fiddle with it.

For comparison, if you save a file from Word, in .rtf format, into which you've pasted a .jpg image, the file created is only slightly larger than the .jpg image.   Much more efficient.

Best wishes, :)

Graham

Tomorrow may be too late ..

GJ

Hi Graham,

Sorry for my late reply....
Indeed what you suggested was what i'm trying to do.
I have a jpg (picture)  that I wanted as background and then put some text (RichEdit - Lucida Console) on it, print it to a PDF file and eventually email that PDF file. Sort of "electronic invoice". Maybe there are better, easy ways to achieve this, so I'm always open to any other suggestion. ;).

Regards,


GJ (Gertjan)