ZennoLab Assemblies Documentation
DrawPartAsBitmap Method
Example 
ZennoLab.CommandCenter Namespace > HtmlElement Class : DrawPartAsBitmap Method

Type: System.Int32

The distance, in pixels, between the left edge of the element and the left edge of its client area.

Type: System.Int32

The distance, in pixels, between the top edge of the element and the top edge of its client area.

Type: System.Int32

The width of the part.

Type: System.Int32

The height of the part.

Type: System.Boolean

true if the tag of this of the element is "img", otherwise, false.

Type: System.String

The parameter use only in demo version. Default value is String.Empty.

Supports rendering part of element to the bitmap.
Syntax
public Bitmap DrawPartAsBitmap( 
   int left,
   int top,
   int width,
   int height,
   bool isImage,
   string hash
)

Parameters

left

Type: System.Int32

The distance, in pixels, between the left edge of the element and the left edge of its client area.

top

Type: System.Int32

The distance, in pixels, between the top edge of the element and the top edge of its client area.

width

Type: System.Int32

The width of the part.

height

Type: System.Int32

The height of the part.

isImage

Type: System.Boolean

true if the tag of this of the element is "img", otherwise, false.

hash

Type: System.String

The parameter use only in demo version. Default value is String.Empty.

Return Value

Type: System.Drawing.Bitmap

The part of image as a bitmap.

Remarks
If the html element has the tag "img" and the method's parameter is true, then this method executes faster.
Example
The following code example demonstrates uses of the DrawPartToBitmap method
// find element by attribute
var he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByAttribute("a", "href", "http://lessons.zennolab.com/ru/index", "regexp", 0);
 
// draw part of bitmap to the string value
var toBitmap = he.DrawPartAsBitmap(0, 0, 20, 20, true);
// find element by attribute
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "href", "http://lessons.zennolab.com/ru/index", "regexp", 0);
 
// draw part of bitmap to the string value
$toBitmap = $he->DrawPartAsBitmap(0, 0, 20, 20, true);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

HtmlElement Class
HtmlElement Members
DrawPartToBitmap Method
DrawAsBitmap Method
DrawToBitmap Method
FindChildByAttribute Method
FindChildById Method
FindChildByName Method
FindChildByTag Method
FindChildByXPath Method