Gets or sets the width of the current object.
Namespace:
C1.C1PreviewMay be specified as auto (Auto), a percentage of the parent's width (e.g. "50%"), an absolute value (using DefaultUnit), an absolute value with unit of measurement (e.g. "12mm"), or an expression referencing this and other objects (e.g. "Max(prev.width,6cm)").
Assembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
Examples
The following code adds an image to the page and scales that image to 50% of the available width with the height scaling automatically:
Copy CodeVisual Basic
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Create a new Render Image, replacing c1logo.png with your image name and location. Dim img As New C1.C1Preview.RenderImage img.Image = Image.FromFile("C:\c1logo.png") ' Scale the image to 50% of the available page width, the height of the image will scale automatically here. img.Width = "50%" ' Create the document. C1PrintDocument1.StartDoc() C1PrintDocument1.RenderBlock(img) C1PrintDocument1.EndDoc() End Sub |
Copy CodeC#
private void Form1_Load(object sender, EventArgs e) { // Create a new Render Image, replacing c1logo.png with your image name and location. C1.C1Preview.RenderImage img = new C1.C1Preview.RenderImage(); img.Image = Image.FromFile("C:\\c1logo.png"); // Scale the image to 50% of the available page width, the height of the image will scale automatically here. img.Width = "50%"; // Create the document. c1PrintDocument1.StartDoc(); c1PrintDocument1.RenderBlock(img); c1PrintDocument1.EndDoc(); } |