 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 203
|
Posted: Fri Jun 07, 2019 4:27 am Post subject: about Canvas.clear()--How to clear the specified area |
|
|
| Code: | if f then f.Destroy() end
f=createForm()
f.BorderStyle='bsNone'
f.Color=0xEDDCBC
f.setSize(300,300)
f.Position='poDesktopCenter'
f.FormStyle='fsSystemStayOnTop'
p=createPanel(f)
p.setSize(150,200)
p.caption="Can't clean up"
function OnPaint(sender,x,y)
local x2,y2=x,y
local cp=sender.Canvas.Pen
local cnv=sender.Canvas
local line=sender.Canvas.Line
local clear=sender.Canvas.clear
for j=100,1,-1 do
cp.Color=0xff*j
for i=1,80-j do
cp.Width=i-1
--line(i,i,i,i)
line(x2,y2,x2,y2)
end
end
cnv.clear(x2,y2,x2,y2)
end
f.setLayeredAttributes(0xB4B4B4,230,3,3)
f.OnMouseDown=function(sender,button,x,y) f.dragNow() OnPaint(sender,x,y) end
p.OnMouseDown=function(sender,button,x,y) f.dragNow() OnPaint(sender,x,y) end |
I want to clear only the drawn area, not the whole area.
What should I do?
|
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Fri Jun 07, 2019 6:32 am Post subject: |
|
|
Either use pen and fillRect at specific area, or just use bitmap redraw specific area you wish to update from bitmap.
And since you asking how to keep panel content, simply call p.repaint() to repaint the panel.
| Code: |
p.OnMouseDown=function(sender,button,x,y) f.dragNow() OnPaint(sender,x,y);sender.repaint();end |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 203
|
Posted: Fri Jun 07, 2019 9:14 am Post subject: |
|
|
| DaSpamer wrote: | Either use pen and fillRect at specific area, or just use bitmap redraw specific area you wish to update from bitmap.
And since you asking how to keep panel content, simply call p.repaint() to repaint the panel. | Wow! You're great. Thank you for your guidance.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|