Sub deco_l(c As Canvas,clone As ImageView,color As Paint) As Image
Dim jo,gc,g As JavaObject
jo = c ' canvas
jo.RunMethod("setWidth",Array(clone.Width)) ' set width
jo.RunMethod("setHeight",Array(clone.Height)) ' set height
gc = jo.RunMethod("getGraphicsContext2D",Null) ' get graphics context
gc.RunMethod("clearRect",Array(0.0,0.0,clone.Width,clone.Height)) ' clear canvas to transparent
gc.RunMethod("setFill",Array(color)) ' make a grey box
Dim yi,hf,arr As Double
yi=0.25*clone.Height
hf=0.75*clone.Height
arr=0.75*clone.Width
'building a path that looks like an arrow
Dim path As List
path.Initialize
gc.RunMethod("beginPath",Null)
gc.RunMethod("moveTo",Array(0.0,yi))
gc.RunMethod("lineTo",Array(0.0,hf))
gc.RunMethod("lineTo",Array(arr,hf))
gc.RunMethod("lineTo",Array(arr,c.Height))
gc.RunMethod("lineTo",Array(c.Width,c.Height/2))
gc.RunMethod("lineTo",Array(arr,0.0))
gc.RunMethod("lineTo",Array(arr,yi))
gc.RunMethod("lineTo",Array(0.0,yi))
gc.RunMethod("closePath",Null)
gc.RunMethod("fill",Null)
gc.RunMethod("rotate",Array(180.00))'????????
g.InitializeNewInstance("javafx.scene.SnapshotParameters",Null) ' javaobject
g.RunMethod("setFill",Array(fx.Colors.Transparent)) ' set snapshot parameter to trans background
Return jo.RunMethod("snapshot",Array(g,Null))