|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Skyrimfus Cheater Reputation: 1
Joined: 17 Mar 2016 Posts: 42
|
Posted: Mon Sep 06, 2021 9:22 am Post subject: Anti-alias circle |
|
|
How to draw a anitialiased circle using canvas?
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Tue Sep 07, 2021 2:52 am Post subject: |
|
|
Code: | if f then f.destroy() end
f=createForm()
function setShape(str, vv)
local vx = str.Width;
local vy = str.Height;
if (bm1) then bm1.destroy() end
if (bm2) then bm2.destroy() end
local multAmount = 10;
local multOffset = 5;
bm1 = createBitmap(vx * multAmount, vy * multAmount)
bm1.Canvas.clear();
bm1.Canvas.Pen.Width = 1;
bm1.Canvas.AntialiasingMode = amOn;
bm1.Canvas.roundRect(0 + multOffset, 0 + multOffset, vx * multAmount - multOffset, vy * multAmount - multOffset, vv * multAmount, vv * multAmount);
bm2 = createBitmap(vx, vy)
bm2.Canvas.clear();
bm2.Canvas.Pen.Width = 1;
bm2.Canvas.AntialiasingMode = amOn;
bm2.Canvas.drawWithMask(0, 0, vx, vy, bm1, 0, 0, vx * multAmount, vy * multAmount);
str.setShape(bm2);
end
for i = 1, 5 do
p = createPanel(f);
p.setSize(40, 40);
p.setPosition(i * 45, 50);
p.Color = i * 50;
setShape(p, 100);
end |
Thanks to atom0s
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
Skyrimfus Cheater Reputation: 1
Joined: 17 Mar 2016 Posts: 42
|
Posted: Fri Sep 10, 2021 10:49 am Post subject: |
|
|
Corroder wrote: | Code: | if f then f.destroy() end
f=createForm()
function setShape(str, vv)
local vx = str.Width;
local vy = str.Height;
if (bm1) then bm1.destroy() end
if (bm2) then bm2.destroy() end
local multAmount = 10;
local multOffset = 5;
bm1 = createBitmap(vx * multAmount, vy * multAmount)
bm1.Canvas.clear();
bm1.Canvas.Pen.Width = 1;
bm1.Canvas.AntialiasingMode = amOn;
bm1.Canvas.roundRect(0 + multOffset, 0 + multOffset, vx * multAmount - multOffset, vy * multAmount - multOffset, vv * multAmount, vv * multAmount);
bm2 = createBitmap(vx, vy)
bm2.Canvas.clear();
bm2.Canvas.Pen.Width = 1;
bm2.Canvas.AntialiasingMode = amOn;
bm2.Canvas.drawWithMask(0, 0, vx, vy, bm1, 0, 0, vx * multAmount, vy * multAmount);
str.setShape(bm2);
end
for i = 1, 5 do
p = createPanel(f);
p.setSize(40, 40);
p.setPosition(i * 45, 50);
p.Color = i * 50;
setShape(p, 100);
end |
Thanks to atom0s |
This isn't antialiased tho
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Fri Sep 10, 2021 2:26 pm Post subject: |
|
|
The default canvas and bitmap objects don't adhere to the anti-alias setting.
You can try and request that DB add support for the better controls such as:
- TBGRACanvas
- TBGRABitmap
As these have much better drawing handling and do adhere to anti-alias settings.
_________________
- Retired. |
|
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
|
|