[]
        
(Showing Draft Content)

GC.Spread.Sheets.FloatingObjects.Picture

Class: Picture

Sheets.FloatingObjects.Picture

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Picture(name, src, x, y, width, height)

Represents a picture.

Parameters

Name Type Description
name string The name of the picture.
src string The image source of the picture.
x number The x location of the picture.
y number The y location of the picture.
width number The width of the picture.
height number The height of the picture.

Overrides

FloatingObject.constructor

Properties

typeName

typeName: string

Represents the type name string used for supporting serialization.

Inherited from

FloatingObject.typeName

Methods

allowMove

allowMove(value?): any

Gets or sets whether to disable moving the floating object.

example

//This example prevents you from moving or resizing the floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? boolean The setting for whether to disable moving the floating object.

Returns

any

If no value is set, returns the setting for whether to disable moving the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.allowMove


allowResize

allowResize(value?): any

Gets or sets whether to disable resizing the floating object.

example

//This example prevents you from moving or resizing the floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? boolean The setting for whether to disable resizing the floating object.

Returns

any

If no value is set, returns the setting for whether to disable resizing the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.allowResize


alt

alt(value?): any

Gets or sets the alternative text of the floating object for screen readers.

Parameters

Name Type Description
value? string The alternative text of the floating object.

Returns

any

The alternative text of the floating object.

Inherited from

FloatingObject.alt


backColor

backColor(value?): any

Gets or sets the background color of the picture.

example

//This example sets the backcolor of the picture.
activeSheet.pictures.add("f2","Event.png",2,2,10,10);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch);
picture.backColor("Blue");
picture.borderWidth(2);
picture.borderColor("Red");

Parameters

Name Type Description
value? string The backcolor of the picture.

Returns

any

If no value is set, returns the backcolor of the picture; otherwise, returns the picture.


borderColor

borderColor(value?): any

Gets or sets the border color of the picture.

example

//This example sets the border color of the picture.
activeSheet.pictures.add("f2","Event.png",2,2,10,10);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch);
picture.backColor("Blue");
picture.borderWidth(2);
picture.borderColor("Red");

Parameters

Name Type Description
value? string The border color of the picture.

Returns

any

If no value is set, returns the border color of the picture; otherwise, returns the picture.


borderRadius

borderRadius(value?): any

Gets or sets the border radius of the picture.

example

//This example uses the borderRadius method.
activeSheet.pictures.add("f2","Event.png",2,2,10,10);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
picture.backColor("Blue");
picture.borderWidth(2);
picture.borderColor("Red");
picture.borderStyle("dotted");
picture.borderRadius(5);

Parameters

Name Type Description
value? number The border radius of the picture.

Returns

any

If no value is set, returns the border radius of the picture; otherwise, returns the picture.


borderStyle

borderStyle(value?): any

Gets or sets the border style of the picture.

example

//This example uses the borderStyle method.
activeSheet.pictures.add("f2","Event.png",2,2,10,10);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
picture.backColor("Blue");
picture.borderWidth(2);
picture.borderColor("Red");
picture.borderStyle("dotted");
picture.borderRadius(5);

Parameters

Name Type Description
value? string The css border style of the picture, such as dotted, dashed, solid, and so on.

Returns

any

If no value is set, returns the border style of the picture; otherwise, returns the picture.


borderWidth

borderWidth(value?): any

Gets or sets the border width of the picture.

example

//This example uses the borderWidth method.
activeSheet.pictures.add("f2","Event.png",2,2,10,10);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch);
picture.backColor("Blue");
picture.borderWidth(2);
picture.borderColor("Red");

Parameters

Name Type Description
value? number The border width of the picture.

Returns

any

If no value is set, returns the border width of the picture; otherwise, returns the picture.


cloneContent

cloneContent(): HTMLElement

Gets a copy of the current content of the instance.

Returns

HTMLElement

A copy of the current content of the instance.

Inherited from

FloatingObject.cloneContent


content

content(value?): any

Gets or sets the content of the custom floating object.

Parameters

Name Type Description
value? HTMLElement The content of the custom floating object.

Returns

any

If no value is set, returns the content of the custom floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.content


dynamicMove

dynamicMove(value?): any

Gets or sets whether the object moves when hiding or showing, resizing, or moving rows or columns.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? boolean The value indicates whether the object moves when hiding or showing, resizing, or moving rows or columns.

Returns

any

If no value is set, returns whether this floating object dynamically moves; otherwise, returns the floating object.

Inherited from

FloatingObject.dynamicMove


dynamicSize

dynamicSize(value?): any

Gets or sets whether the size of the object changes when hiding or showing, resizing, or moving rows or columns.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? boolean The value indicates whether the size of the object changes when hiding or showing, resizing, or moving rows or columns.

Returns

any

If no value is set, returns whether this floating object dynamically changes size; otherwise, returns the floating object.

Inherited from

FloatingObject.dynamicSize


endColumn

endColumn(value?): any

Gets or sets the end column index of the floating object position.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);

Parameters

Name Type Description
value? number The end column index of the floating object position.

Returns

any

If no value is set, returns the end column index of the floating object position; otherwise, returns the floating object.

Inherited from

FloatingObject.endColumn


endColumnOffset

endColumnOffset(value?): any

Gets or sets the offset relative to the end column of the floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);

Parameters

Name Type Description
value? number The offset relative to the end column of the floating object.

Returns

any

If no value is set, returns the offset relative to the end column of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.endColumnOffset


endRow

endRow(value?): any

Gets or sets the end row index of the floating object position.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);

Parameters

Name Type Description
value? number The end row index of the floating object position.

Returns

any

If no value is set, returns the end row index of the floating object position; otherwise, returns the floating object.

Inherited from

FloatingObject.endRow


endRowOffset

endRowOffset(value?): any

Gets or sets the offset relative to the end row of the floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);

Parameters

Name Type Description
value? number The offset relative to the end row of the floating object.

Returns

any

If no value is set, returns the offset relative to the end row of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.endRowOffset


fixedPosition

fixedPosition(value): any

Gets or sets whether the position of the floating object is fixed. When fixedPosition is true, dynamicMove and dynamicSize are disabled.

example

//This example sets the position of the object to fixed.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.fixedPosition(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value boolean The value indicates whether the position of the floating object is fixed.

Returns

any

If no value is set, returns whether the position of the floating object is fixed; otherwise, returns the floating object.

Inherited from

FloatingObject.fixedPosition


getHost

getHost(): HTMLElement[]

Gets the dom host of the custom content.

Returns

HTMLElement[]

Inherited from

FloatingObject.getHost


getOriginalHeight

getOriginalHeight(): number

Gets the original height of the picture.

example

activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
//button
$("#button1").click(function () {
  alert(picture.getOriginalHeight());
});

Returns

number

The original height of the picture.


getOriginalWidth

getOriginalWidth(): number

Gets the original width of the picture.

example

activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
//button
$("#button1").click(function () {
     alert(picture.getOriginalWidth());
});

Returns

number

The original width of the picture.


height

height(value?): any

Gets or sets the height of a floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? number The height of a floating object.

Returns

any

If no value is set, returns the height of a floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.height


isLocked

isLocked(value?): any

Gets or sets whether this floating object is locked.

example

var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
customFloatingObject.isLocked(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.options.isProtected = true;

Parameters

Name Type Description
value? boolean The value that indicates whether this floating object is locked.

Returns

any

If no value is set, returns whether this floating object is locked; otherwise, returns the floating object.

Inherited from

FloatingObject.isLocked


isSelected

isSelected(value?): any

Gets or sets whether this floating object is selected.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isSelected(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? boolean The value that indicates whether this floating object is selected.

Returns

any

If no value is set, returns whether this floating object is selected; otherwise, returns the floating object.

Inherited from

FloatingObject.isSelected


isVisible

isVisible(value?): any

Gets or sets whether this floating object is visible.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? boolean The value that indicates whether this floating object is visible.

Returns

any

If no value is set, returns whether this floating object is visible; otherwise, returns the floating object.

Inherited from

FloatingObject.isVisible


name

name(value?): any

Gets the name of the floating object.

example

//This example uses the name method.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject();
customFloatingObject.name("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? string The name of the floating object.

Returns

any

If no value is set, returns the name of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.name


pictureStretch

pictureStretch(value?): any

Gets or sets the stretch of the picture.

example

//This example uses the pictureStretch method.
activeSheet.pictures.add("f2","Event.png",2,2,10,10);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch);
picture.backColor("Blue");
picture.borderWidth(2);
picture.borderColor("Red");

Parameters

Name Type Description
value? ImageLayout The stretch of the picture.

Returns

any

If no value is set, returns the stretch of the picture; otherwise, returns the picture.


refreshContent

refreshContent(): void

Refresh the content in floatingObject.The user should override this method to make their content synchronize with the floatingObject.

Returns

void

Inherited from

FloatingObject.refreshContent


src

src(value?): any

Gets or sets the src of the picture.

Parameters

Name Type Description
value? string The src of the picture.

Returns

any

If no value is set, returns the src of the picture; otherwise, returns the picture.


startColumn

startColumn(value?): any

Gets or sets the starting column index of the floating object position.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);

Parameters

Name Type Description
value? number The starting column index of the floating object position.

Returns

any

If no value is set, returns the starting column index of the floating object position; otherwise, returns the floating object.

Inherited from

FloatingObject.startColumn


startColumnOffset

startColumnOffset(value?): any

Gets or sets the offset relative to the start column of the floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);

Parameters

Name Type Description
value? number The offset relative to the start column of the floating object.

Returns

any

If no value is set, returns the offset relative to the start column of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.startColumnOffset


startRow

startRow(value?): any

Gets or sets the starting row index of the floating object position.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);

Parameters

Name Type Description
value? number The starting row index of the floating object position.

Returns

any

If no value is set, returns the starting row index of the floating object position; otherwise, returns the floating object.

Inherited from

FloatingObject.startRow


startRowOffset

startRowOffset(value?): any

Gets or sets the offset relative to the start row of the floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//takes effect when added into the sheet.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);

Parameters

Name Type Description
value? number The offset relative to the start row of the floating object.

Returns

any

If no value is set, returns the offset relative to the start row of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.startRowOffset


width

width(value?): any

Gets or sets the width of a floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? number The width of a floating object.

Returns

any

If no value is set, returns the width of a floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.width


x

x(value?): any

Gets or sets the horizontal location of the floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? number The horizontal location of the floating object.

Returns

any

If no value is set, returns the horizontal location of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.x


y

y(value?): any

Gets or sets the vertical location of the floating object.

example

//This example creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

Parameters

Name Type Description
value? number The vertical location of the floating object.

Returns

any

If no value is set, returns the vertical location of the floating object; otherwise, returns the floating object.

Inherited from

FloatingObject.y