Hello!
When I use display.capture and display.save the new object I get has a black border around it.
What I have done is I have created a new rectangle (display.newRect()) and I have created a a grid on that rectangle using lines horisontaly and verticaly. The lines are not outside the rectangle as far as the eye can see.
I put all this in a group and use display.capture(group) and I get a new object with a black border.
I dont want that black border because the new object is a base for a chart I’m creating.
Here is the code if you can read it…
local chart1 = display.newGroup() chart1.hasDot = false chart1.hasLine = false chart1.x, chart1.y = 5, 5 local function init\_chart() local chart\_bg = display.newRect(0,0, 600, 400) chart\_bg:setStrokeColor(180, 180, 180) chart1:insert(chart\_bg) local linje = {} local linje1 = {} for i=1, ((chart\_bg.height/50 )+ 1), 1 do linje.i = display.newLine( 0, (chart\_bg.height-(i)\*50), chart\_bg.width, (chart\_bg.height-(i)\*50) ) linje.i:setColor(100,100,100) linje.i.width = 1 chart1:insert(linje.i) end for i=1, ((chart\_bg.width/50 )+ 1), 1 do linje1.i = display.newLine( chart\_bg.width - i\*50, 0, chart\_bg.width- i\*50, chart\_bg.height ) linje1.i:setColor(100,100,100) linje1.i.width = 1 chart1:insert(linje1.i) end copy = display.capture(chart1, "chartinit.bmp") for i=chart1.numChildren,1,-1 do local child = chart1[i] child.parent:remove( child ) end chart1:insert(copy) end
Kinde regards!