Image
()Картинка, CreateImage()
, GetLastImage()
Данный объект можно использовать и как холст, для рисования
Также имеет аналогичные методы:
GetHeight()
GetVisibility()
GetWidth()
SetFontFile()
SetMargins()
SetOnTouch()
- в обработчик передается эвент событияimg.SetOnTouch(function(event){ app.ShowPopup(event.action); // Down, Up, Move app.ShowPopup(event.x); app.ShowPopup(event.y); });
SetOnLongTouch()
SetOnTouchDown()
- в обработчик передается эвент события
SetOnTouchMove()
SetOnTouchUp()
SetPadding()
SetPosition()
SetSize()
SetTextSize()
- устанавливает цвет шрифта для рисования
SetTouchable()
SetVisibility()
Image.
GetAbsHeight
()Image.
GetAbsWidth
()Image.
GetPixelData
(format, left, top, width, height)Image.
Clear
()Очищает изображение
Image.
DrawArc
(x1, y1, x2, y2, start, sweep)Image.
DrawCircle
(x, y, radius)Рисует окружность, с цуказанным центром и радиусом
img.DrawCircle(0.2, 0.2, 0.1);
Image.
DrawImage
(image, x, y, w, h, angle)Image.
DrawImageMtx
(image, matrix)Image.
DrawLine
(x1, y1, x2, y2)Рисует линии по указанным точкам
img.DrawLine(0.6, 0.2, 0.7, 0.95);
Image.
DrawPoint
(x, y)Рисует точку на изображении
img.DrawPoint(0.5, 0.5);
Image.
DrawRectangle
(x1, y1, x2, y2, ?)Рисует прямоугльник
img.DrawRectangle(0.22, 0.7, 0.9, 0.88);
img.DrawRectangle(0.22, 0.7, 0.9, 0.88, 0.03);
Image.
DrawText
(text, x, y)Рисует текст на изображении, SetTextSize()
img.DrawText('Hello', 0.1, 0.8);
Image.
Move
(x, y)Смешает изображение
img.Move(0, 0.15);
Image.
Reset
()Сбросить масштаб изображения до указанных
img.Reset(1.0, 1.0);
Image.
Rotate
(angle, pivotX, pivotY)Вращает изображение на указанныей градус, относительно укзанной точки экрана
image.Rotate(3, 0.5, 0.5);
Image.
Save
(fileName)Image.
SetAlpha
(alpha)img.SetAlpha(1.0);
Image.
SetAutoUpdate
(onoff)Image.
SetColor
(colorCode)Заливает изображение указанным цветом
img.SetColor('red');
Image.
SetImage
(img, width, height)Image.
SetLineWidth
(width)Устанавливает размер линии для рисования
img.SetLineWidth(2.5);
Image.
SetMaxRate
(ms)Image.
SetOnLoad
(callback)Image.
SetPaintColor
(colorCode)Устанавливает цвет кисти для рисования
img.SetPaintColor('blue');
Image.
SetPaintStyle
(style)Устанавливает стиль линии для рисования:
Line - замкнутые фигуры не будут залиты цветом
img.SetPaintStyle('Line');
Image.
Scale
(x, y)Масштабирует изображение
img.Scale(0.3, 0.3);
Image.
Skew
(x, y)Image.
Transform
(matrix)Image.
Update
()Image.Clear() Image.Destroy() Image.Draw( func, p1, p2, p3, p4, p5, p6, p7 ) Image.DrawArc( x1, y1, x2, y2, start, sweep ) Image.DrawCircle( x,y,radius ) Image.DrawImage( image, x, y, w, h, angle ) Image.DrawImageMtx( image, matrix ) Image.DrawLine( x1, y1, x2, y2 ) Image.DrawPoint( x, y ) Image.DrawRectangle( x1, y1, x2, y2 ) Image.DrawText( txt, x, y ) Image.GetAbsHeight() Image.GetAbsWidth() Image.GetHeight() Image.GetName() Image.GetPixelData( format, left, top, width, height ) format can be “rawbase64”, “pngbase64” or “jpgbase64” Image.GetPosition() returns an object with properties: left, top, width, height Image.GetType() Image.GetVisibility() Image.GetWidth() Image.Move( x, y ) Image.Release() Image.Reset() Image.Rotate( angle, pivotX, pivotY ) Image.Save( fileName,quality ) quality parameter new since Vers 1.29 support for png files since Vers 1.29 Image.Scale( x, y ) Image.SetAlpha( alpha ) Image.SetAutoUpdate( onoff ) Image.SetBackColor( colorCode ) Image.SetBackGradient( color1,color2,color3,p4,p5,p6,p7 ) Image.SetBackGradientRadial( x,y,r,color1,color2,color3,p7 ) Image.SetBackground( imagefile,options ) Image.SetColor( color ) Image.SetFontFile( file ) Image.SetImage( image,width,height,options ) Image.SetLineWidth( width ) Image.SetMargins( left,top,right,bottom ) Image.SetMaxRate( ms ) Set the minimum amount of time (in ms) between OnTouchMove events Image.SetName( p1 ) Image.SetOnLoad( callback ) Image.SetOnLongTouch( callback ) Image.SetOnTouch( callback ) Image.SetOnTouchDown( callback ) Image.SetOnTouchMove( callback ) Image.SetOnTouchUp( callback ) Image.SetPadding( left, top, right, bottom ) Image.SetPaintColor( color ) Image.SetPaintStyle( style ) Image.SetPosition( left, top, width, height ) Image.SetScale( x,y ) Fract values (as usual): 1=original, -1=flip (mirror) Image.SetSize( width, height ) Image.SetTextSize( size ) Image.SetTouchable( callback ) Image.SetVisibility( HideShow ) Image.Skew( p1,p2 ) Image.Transform( matrix ) Image.Update() Image.Update2()