Products Technologies Demo Docs Blog Support Company

ActiveX: Export the Page Content As an Image in VB6

ActiveX? Isn't that a dead technology? You might hear this very often when talking about Visual Basic 6 or ActiveX controls. But we still have a strong client base using our ActiveX version in Visual Basic 6, Delphi, Sybase PowerBuilder or MS Access. And we have committed to support this technology with the same innovation and developer power. We know that it takes time to port such legacy applications to newer technologies such as Windows Forms or WPF. Therefore, we are supporting our user…

ActiveX: Export the Page Content As an Image in VB6

ActiveX? Isn't that a dead technology?

You might hear this very often when talking about Visual Basic 6 or ActiveX controls. But we still have a strong client base using our ActiveX version in Visual Basic 6, Delphi, Sybase PowerBuilder or MS Access.

And we have committed to support this technology with the same innovation and developer power. We know that it takes time to port such legacy applications to newer technologies such as Windows Forms or WPF. Therefore, we are supporting our user base as best as possible with new versions, updates and technical support.

Today, I would like to introduce a feature that has been implemented in the latest version 16.0. In TX Text Control ActiveX, the Page Rendering Engine is accessible throught the PageImage property. It returns an image of the specified page which can be used with the Picture property of a Form object, PictureBox control or Image control.

To display a specific page on a PictureBox in VB6, the following code in required:

Picture1.Picture = TXTextControl1.PageImage(1, pcAll)

In order to save the image as an enhanced Metafile, the SavePicture method can be used:

SavePicture TXTextControl1.PageImage(1, pcAll), "test.emf"

The following constants are available:

Constant Description
pcBackground The image contains the background of the page.
pcHeadersAndFooters The image contains the header and the footer of the page.
pcMainText The image contains the page's text contents.
pcAll The image contains all parts.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

Windows FormsWPF.NET

Create a Table of Contents in Windows Forms using C#

This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.


ASP.NETWindows FormsWPF

Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub

This article gives a quick overview of the new repositories, their structure and our plans for the future.


ASP.NETJavaScriptDocument Editor

Detect Toggle Button Changes Using a MutationObserver

This article shows how to detect changes of toggle buttons in the ribbon of the web editor using a MutationObserver. The state of a toggle button in the ribbon visualizes the state of a certain…


Windows FormsList.NET

Two Ways to Restart Numbered Lists in TX Text Control

In TX Text Control, numbered lists are continued by default and need to be reset when required. There is more than one way if you want to restart numbered lists in a document. In this article, two…


Windows FormsSampleShortcuts

Zoom Tricks: Disabling CTRL + MOUSE WHEEL and More

This article shows how to disable CTRL + MOUSE WHEEL, implement zooming with keyboard and reset the zoom factor to its default value.