[]
        
(Showing Draft Content)

C1.Win.TouchToolKit.C1MultiScaleImage

C1MultiScaleImage Class

Represents a control which can display different images for different zoom factor of the control.

Inheritance
C1MultiScaleImage
Namespace: C1.Win.TouchToolKit
Assembly: C1.Win.TouchToolKit.8.dll
Syntax
[ToolboxBitmap(typeof(C1MultiScaleImage), "MultiScaleImage.png")]
public class C1MultiScaleImage : PictureBox, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, ISupportInitialize
Examples

The following code example shows how to use the C1MultiScaleImage component.

You can copy the code to a exsit Windows Forms appliction. And set the form in the sample code as start form.

If you find a licenses error when run this code. Try to drag a C1MultiScaleImage component to a any Form from tool box can generate the licenses information to this project.

public class GcMultiScaleImageDemo : Form
{
	private GcZoom _gcZoomObj;
	private GcMultiScaleImage _gcmultiScaleImage;

	public GcMultiScaleImageDemo()
 	{
		InitializeComponent();

		_gcZoomObj = new GcZoom();
		_gcZoomObj.Target = this;
	}

	private void InitializeComponent()
	{
		ImageItem item1 = new ImageItem();
		item1.Image = Image.FromFile(@"C:\image1.jpg");
		item1.ZoomFactor = 1.5f;

		ImageItem item2 = new ImageItem();
		item2.Image = Image.FromFile(@"C:\image2.jpg");
		item2.ZoomFactor = 2f;

		_gcmultiScaleImage = new GcMultiScaleImage();
		_gcmultiScaleImage.Location = new Point(20, 20);
		_gcmultiScaleImage.Size = new Size(100, 100);
		_gcmultiScaleImage.BackColor = Color.Red;

		_gcmultiScaleImage.ZoomFactor = 1f;
		_gcmultiScaleImage.Image = Image.FromFile(@"C:\image.jpg");
		_gcmultiScaleImage.SizeMode = PictureBoxSizeMode.StretchImage;

		_gcmultiScaleImage.Images.Add(item1);
		_gcmultiScaleImage.Images.Add(item2);

		this.Controls.Add(_gcmultiScaleImage);
	}
}
Public Class GcMultiScaleImageDemo
	Inherits Form
	Private _gcZoomObj As GcZoom
	Private _gcmultiScaleImage As GcMultiScaleImage

	Public Sub New()
		InitializeComponent()

		_gcZoomObj = New GcZoom()
		_gcZoomObj.Target = Me
	End Sub

	Private Sub InitializeComponent()
		Dim item1 As New ImageItem()
		item1.Image = Image.FromFile("C:\image1.jpg")
		item1.ZoomFactor = 1.5F

		Dim item2 As New ImageItem()
		item2.Image = Image.FromFile("C:\image2.jpg")
		item2.ZoomFactor = 2.0F

		_gcmultiScaleImage = New GcMultiScaleImage()
		_gcmultiScaleImage.Location = New Point(20, 20)
		_gcmultiScaleImage.Size = New Size(100, 100)
		_gcmultiScaleImage.BackColor = Color.Red

 		_gcmultiScaleImage.ZoomFactor = 1.0F
 		_gcmultiScaleImage.Image = Image.FromFile("C:\image.jpg")
	 	_gcmultiScaleImage.SizeMode = PictureBoxSizeMode.StretchImage

 		_gcmultiScaleImage.Images.Add(item1)
 		_gcmultiScaleImage.Images.Add(item2)

 		Me.Controls.Add(_gcmultiScaleImage)
	End Sub
End Class

Constructors

Name Description
C1MultiScaleImage()

Initializes a new instance of the C1MultiScaleImage class.

Properties

Name Description
Images

Gets the a group of ImageItem that display specific image in specific zoom factor.

ZoomFactor

Gets or sets the zoom factor of the control.

Methods

Name Description
AboutBox()

Shows the product information window.