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

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 to the bitmap.
Syntax
public Bitmap DrawAsBitmap( 
   bool isImage,
   string hash
)

Parameters

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 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 DrawAsBitmap method
// find element by attribute
var he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
 
// draw to bitmap element, this element is not image and does not contain image
var toBitmap1 = he.DrawAsBitmap(false);
 
// find element by attribute
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByAttribute("a", "href", "http://lessons.zennolab.com/ru/index", "regexp", 0);
 
// draw to bitmap element, this element is image or contains image
var toBitmap2 = he.DrawAsBitmap(true);
// find element by attribute
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
 
// draw to bitmap element, this element is not image and does not contain image
$toBitmap1 = $he->DrawAsBitmap(false);
 
// find element by attribute
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "href", "http://lessons.zennolab.com/ru/index", "regexp", 0);
 
// draw to bitmap element, this element is image or contains image
$toBitmap2 = $he->DrawAsBitmap(true);
Requirements

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

See Also

Reference

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