How to insert a fixed image at the current input position
In this newsletter, we are going to show you how to insert an image at the current input position. In a previous newsletter, we have shown you how to do this with the ActiveX version of TX Text Control. Today, we are going to show you how to achieve the same with TX Text Control .NET for Windows Forms.
Using the .NET version, it is much easier to get the current input position. Consider the following three steps:
First of all, using the InputPosition.Location property, we can get the coordinates of the current cursor position.
Secondly, we have to specify the image properties before finally, we add the image to the specified location.
Dim image As New TXTextControl.Image()
Dim location As System.Drawing.Point
location = TXTextControl1.InputPosition.Location
image.FileName = "logo.png"
image.Sizeable = True
image.Moveable = True
image.HorizontalScaling = 100
image.VerticalScaling = 100
image.SaveMode = TXTextControl.ImageSaveMode.SaveAsData
TextControl1.Images.Add(Image, location, TXTextControl.ImageInsertionMode.DisplaceText)
Please note that Visual Studio .NET 2002 or better and TX Text Control .NET for Windows Forms are required for this sample application.
Save 50% with TX Text Control Team Licenses
TX Text Control Team Licenses are a cost effective way to purchase licenses for a team of developers. If you already own a license for a single developer, a Team License Upgrade may be a money saving option for you.
Team Licenses and upgrades for four developers are available at a discount of 50% at the TX Text Control online shop.
Please contact the Sales Department or call us on the phone if you have questions about licensing.
The Newsletter Team