 |
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: Tue Sep 15, 2020 9:23 am Post subject: I think CE7.1 can help me make a circular image and save it |
|
|
Like the effect in the example figure, how to turn a right angle image into a circular image, and then save it to disk
| Description: |
|
| Filesize: |
761.29 KB |
| Viewed: |
1926 Time(s) |

|
|
|
| Back to top |
|
 |
Oxijen Expert Cheater
Reputation: 0
Joined: 07 May 2020 Posts: 163 Location: On The Moon
|
Posted: Wed Sep 16, 2020 10:25 am Post subject: |
|
|
| just use photoshop, I don't think you really can
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Thu Sep 17, 2020 4:44 am Post subject: |
|
|
This is not perfect and I don't know how to save the result to local disk, except creating and using circular crop TImage. Maybe someone else known it better, but who care about my opinion?. LOL!
| Code: | if f then f.destroy() end
f = createForm()
f.setSize(400,400)
f.Position = 'poScreenCenter'
f.Color = 997002
p = createPanel(f)
p.setSize(380,380)
p.setPosition(10,10)
img = createImage(p)
img.setSize(380,380)
img.setPosition(0,0)
img.Stretch = true
img.Picture.loadFromStream(findTableFile('girl.png').stream)
img.OnMouseDown = function() f.dragNow() end
p.OnPaint = function()
if ABitmap then ABitmap.Destroy() end
ABitmap = createBitmap(p)
ABitmap.Width = p.Width
ABitmap.Height = p.Height
ABitmap.Canvas.Brush.Color = 0
ABitmap.Canvas.fillRect(0,0, p.Width, p.Height)
ABitmap.Canvas.Brush.Color = 0xffffff
ABitmap.Canvas.ellipse(0, 0, p.Width, p.Height)
p.setShape(ABitmap)
end |
| Description: |
|
| Filesize: |
38.04 KB |
| Viewed: |
1841 Time(s) |

|
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 203
|
Posted: Thu Sep 17, 2020 8:18 am Post subject: |
|
|
@Corroder
You can copy the image to a bitmap and save it to disk in the following way:
| Code: | | ABitmap.SaveToFile([[C:\\bla.jpg]]) |
| Description: |
|
| Filesize: |
7.96 KB |
| Viewed: |
1827 Time(s) |

|
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Thu Sep 17, 2020 7:06 pm Post subject: |
|
|
@lua, yes I know. I can use copyRect, but that only copy and save the rect (in this case is ABitmap). What I mean is, save the rect including the picture image.
In C#/VB Net I can use graphic path, region and set clip to get the source image turn into circular crop and save it as new image. Idk how to do that in CE Lua.
And the other question is. How to make selection in CE Lua, to select an area of the screen. Using tag?. Then about SetBounds().
Example in Lazarus / free pascal:
| Code: | Sel.Visible = true
Sel.SetBounds(prevX, prevY, X-prevX, y-prevY)
|
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Fri Sep 18, 2020 7:15 am Post subject: |
|
|
Ok. This is the work one. Change square image circle shape and save the result to local disk.
Note:
I don't know why it take about 1 minutes when do copyRect, before get the result.
| Code: | if f then f.destroy() end
f = createForm()
f.setSize(800,400)
f.Position = 'poScreenCenter'
p = createPanel(f)
p.setSize(380,380)
p.setPosition(10,10)
img = createImage(p)
img.setSize(380,380)
img.setPosition(10,10)
img.Stretch = true
img.Picture.loadFromStream(findTableFile('girl.png').stream)
img2 = createImage(f)
img2.setSize(380,380)
img2.setPosition(400,10)
img2.Stretch = true
p.OnPaint = function()
if ABitmap then ABitmap.Destroy() end
ABitmap = createBitmap(p)
ABitmap.Width = p.Width
ABitmap.Height = p.Height
ABitmap.Canvas.Brush.Color = 0
ABitmap.Canvas.fillRect(0,0, p.Width, p.Height)
ABitmap.Canvas.Brush.Color = 0xffffff
ABitmap.Canvas.ellipse(0, 0, p.Width, p.Height)
p.setShape(ABitmap)
img2.Picture.Bitmap.Width= img2.Width
img2.Picture.Bitmap.Height= img2.Height
sc = img.getCanvas()
img2.canvas.copyRect(0,0, img2.Width, img2.Height, sc, 0, 0, img2.Width, img2.Height)
img2.Picture.SaveToFile('D:\\test.png')
ABitmap.Destroy()
end
|
| Description: |
|
| Filesize: |
52.21 KB |
| Viewed: |
1786 Time(s) |

|
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 203
|
Posted: Fri Sep 18, 2020 8:48 am Post subject: |
|
|
| Corroder wrote: |
Note:
I don't know why it take about 1 minutes when do copyRect, before get the result. | You should add the following to the function: | Code: | | img.Transparent=true |
| Corroder wrote: | Ok. This is the work one. Change square image circle shape and save the result to local disk.
| The color of the form will be used as the background color of img2. Now how to remove the background color and leave only the circular image, CE seems to have no function to cut the image.(Images on disk, not on forms)
Finally, does the Delphi code in the figure have reference value
| Description: |
|
| Filesize: |
25.7 KB |
| Viewed: |
1753 Time(s) |

|
| Description: |
|
| Filesize: |
320.91 KB |
| Viewed: |
1771 Time(s) |

|
|
|
| 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
|
|