View previous topic :: View next topic |
Author |
Message |
HexaG0n Advanced Cheater Reputation: 0
Joined: 29 Mar 2021 Posts: 64
|
Posted: Wed Jul 20, 2022 2:26 am Post subject: picture ScreenToClient / picture left, top pos [ in image ] |
|
|
how can i get ScreenToClient to work with pictures?
and how can i also get the position of a picture inside an image?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Wed Jul 20, 2022 3:14 am Post subject: |
|
|
Pictures aren't real/visible. Only when they have been drawn onto an image or paintbox they become visible.
Getting the position of a picture inside an image is up to you. Keep track of where you draw the picture in the image
Pictures also don't have ScreenToClient, only Image, Paintbox and other actual "Controls" have that
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
HexaG0n Advanced Cheater Reputation: 0
Joined: 29 Mar 2021 Posts: 64
|
Posted: Wed Jul 20, 2022 6:46 am Post subject: |
|
|
how can i get the position of a picture in an image?
i just want to convert ScreenToClient from the image into the picture x, y pos because if the image has center set to true, ScreenToClient is not in the picture
i can use this: Code: | local w = (img.Width - img.Picture.Bitmap.Width) // 2
local h = (img.Height - img.Picture.Bitmap.Height) // 2
local x, y = img.ScreenToClient()
x, y = x - w, x - h |
but if the picture gets shrunk, this wont work
|
|
Back to top |
|
|
|