Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How canvas fills colors based on shape areas

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Apr 16, 2022 9:51 am    Post subject: How canvas fills colors based on shape areas Reply with quote

How to fill a triangle or draw a solid triangle
Code:
if f then f.Destroy() end
f=createForm()
f.OnPaint=function()
  f.Canvas.Pen.Color=0x123456
  f.Canvas.MoveTo(100,100)
  f.Canvas.LineTo(200,200)
  f.Canvas.LineTo(150,220)
  f.Canvas.LineTo(100,100)
  f.Canvas.FloodFill(0,0,0x123456,fsSurface)--fsSurface fsBorder
  f.Canvas.Brush.Color=0x00ff00
  f.Canvas.ellipse(10,10,100,100)
end
f.Repaint()



triangle .png
 Description:
 Filesize:  7.06 KB
 Viewed:  1286 Time(s)

triangle .png


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat Apr 16, 2022 10:35 pm    Post subject: This post has 1 review(s) Reply with quote

Code:
if f then f.Destroy() end
f=createForm()
f.OnPaint=function()
  f.Canvas.Pen.Color=0x123456
  f.Canvas.MoveTo(100,100)
  f.Canvas.LineTo(200,200)
  f.Canvas.LineTo(150,220)
  f.Canvas.LineTo(100,100)
  f.Canvas.Brush.Color=0x00ff00
  f.Canvas.ellipse(10,10,100,100)
end
f.Repaint()

f.OnClick=function(sender,x,y)  ---- ONLY click on triangle
 local x,y = f.ScreenToClient(getMousePos())
 local TempColor = f.Canvas.getPixel(x, y)
 f.Canvas.Brush.Style = 0
 f.Canvas.Brush.Color = 0x0000ff  --- red
 f.Canvas.FloodFill(x, y, TempColor, 'fsSurface')
 f.Canvas.Brush.Style = 1
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sun Apr 17, 2022 9:51 am    Post subject: Reply with quote

Great. Besides filling triangles, are other shapes the same?
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Apr 17, 2022 9:00 pm    Post subject: Reply with quote

.lua wrote:
Great. Besides filling triangles, are other shapes the same?


Yes, it this

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites