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 


picture ScreenToClient / picture left, top pos [ in image ]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Wed Jul 20, 2022 2:26 am    Post subject: picture ScreenToClient / picture left, top pos [ in image ] Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25287
Location: The netherlands

PostPosted: Wed Jul 20, 2022 3:14 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Wed Jul 20, 2022 6:46 am    Post subject: Reply with quote

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