Link to home
Start Free TrialLog in
Avatar of AlexF777
AlexF777

asked on

RichTextBox => .TIFF

Hello,

We are trying to convert some text files into tiff while highlighting certain phrases in the same
time. At the moment, an approach we are considering is to use VB
RichTextBox control, which allows to use Bold, Underlined formatting options, along with different
text colors. The question is, should we try to Save it as .rtf and then try to convert to tiff, or
may be there is a way to save info to tiff directly from RichTextBox or may be there are other
alternatives ?

Thank You
Avatar of AzraSound
AzraSound
Flag of United States of America image

My recommendation:   RTF -> PictureBox -> Tif


===================================
RTF -> Picturebox

RichTextBox1.SelPrint PictureBox.hDC
PictureBox.Picture = PictureBox.Image
===================================


===================================
PictureBox -> Tif

Use GDI+
Reference:
http://www.vbaccelerator.com/home/VB/Code/vbMedia/Using_GDI_Plus/Reading_and_Writing_JPG__PNG__TIF_and_GIF_Files/article.asp
===================================

Avatar of AlexF777
AlexF777

ASKER

AzraSound

To my knowledge SelPrint does not keep formatting options, although idea is pretty good
At the moment I am working with www.eprintdriver.com
to use their product. It is pretty close.
However, if nobody gives me a better suggestion,
You still get the points ....

AlexF777
ASKER CERTIFIED SOLUTION
Avatar of AzraSound
AzraSound
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi AzraSound,

I was going thru your post and curious of how it works, I tested:

RichTextBox1.SelPrint PictureBox.hDC
PictureBox.Picture = PictureBox.Image

The Picture box is always empty, however, if I remove PictureBox.Picture = PictureBox.Image, I get to display
the content of the richtextBox in the picturebox.

Am I missing something?  Please advise.  Also could you suggest how should I integrate with GDI+?

I'm willing award 150 pts for this.

Cheers!


Set the PictureBox's AutoRedraw property to True
cools, just found out that portion on setting the AutoRedraw to True.

I also relise that the image written to file has unwanted area. i.e. the image copied from RTF file is smaller than the actual image size and I end up with grey bothers....  any suggestions?

How about the part on GDI+?  Thanks!  I'll try the integration as well.

Thanks!