Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RTF Control - adding graphics - VB5

Posted on 1997-07-16
4
Medium Priority
?
393 Views
Last Modified: 2012-08-14
When I add a wmf file to an rtf control using the OleObjects.Add method, windows tries to start up the application associated with the graphic's file extension.  How can I add an image to the rtf control without launching the associated app?  Also, when I save the contents of the control to an RTF file, the file is 32meg, but there is only about 200k worth of data there.  Is there a memory leak?
0
Comment
Question by:swpb
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
volking earned 360 total points
ID: 1428453
RTF stands for Rich TEXT Format. I emphasize the word TEXT. (So did Microsoft when I called them). The RTF control does not handle graphics. No If's, No And's, No But's ... it does NOT handle graphics.

I needed the same functionality you describe (I even called Microsoft and spent $95 on a Tech Support call!!!!!!) Bottom line, I ended up using the WordPad (a scaled down version of Word) to accomplish what I wanted via OLE.

RTF is for TEXT only ....

============> Frederick
0
 
LVL 5

Expert Comment

by:volking
ID: 1428454
Also, about the SIZE ... depending on what formatting you're using as well as what fonts, the file size can grow tremendously. I even discovered that certain fonts were actually stored INSIDE the RTF file. Something about nonstandard TrueType fonts. Although, 200k to 32 megabytes is quite a large inflation. I don't think I've ever seen that much growth. (and by-the-way, I've written two large scale business applications that use RTF extensively. One of them currently contains approximately 60,000 documents.)

=================> Frederick
0
 

Author Comment

by:swpb
ID: 1428455
You sound a bit pretentious, but your explanation of the file size increase is a good one.  I ended up using the Visual Writer control from Powersoft.  It handles graphics just fine.  Costs less than a tech support call too.
0
 

Expert Comment

by:jugular0
ID: 4268851
VB6 supported RTF codes include \pict, \wbitmap, \wmetafile among others. This means that you can inlude pictures in the RTF control. The RTF control in VB5 may have been more limited. In order to include a bitmap, for example, you would write the following string to the RTFtextbox.

{\pict\wbitmap0\picwN\pichN\picwgoalN\pichgoalN...etc.....\binN  #BDATA}

where the bitmap properties (height, width) can be obtained from the API call GetObject, and the #BDATA is the byte information obtained from the API call GetBitmapBits. Look at the Platform SDK for more information.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question