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 


Autosize causing C.E to crash

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Thu Nov 03, 2016 2:53 am    Post subject: Autosize causing C.E to crash Reply with quote

Hey,
I have the following code
Code:
base = "C:\\Work\\images\\launcher.jpg";
f = f or createForm()
i = i or createImage(f);

i.Picture.loadFromFile(base)
i.autosize = true;
f.autosize = true;

f.windowState = "wsMinimized"   

-- should throw this error
-- TControl.ChangeBounds loop detect UDF_0:TCEForm
-- Left=0,Top=0,width=65568...


Executing it will cause Cheat Engine throw error message and start bugging out.

I was trying to load image and autosize the image and form.
It seems that autosizing the form causes the crash.

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Nov 03, 2016 4:21 am    Post subject: Reply with quote

autosize can be finicky yes. Especially on forms and certain controls (especially images. Getting the ce logo to not cause a crash was a challenge)


with autosize sometimes you have to do a quick toggle of true/false, and other times you must set minimum size constraints, and again other times you must use anchors.


in this case, try putting the image in a panel, set the image align to alClient and after loading, set the panel with and height to that of the image's picture object


and i recommend turning off autosize before you minimize the form (autosize is only needed once)

_________________
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
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Nov 03, 2016 7:47 am    Post subject: Reply with quote

Try with this custom build:
https://docs.google.com/uc?authuser=0&id=0BwMAnE6mjogMUHI5cFMxSnMxcWc&export=download
(Extract over CE6.6)

Waiting for feedback.

_________________
Back to top
View user's profile Send private message MSN Messenger
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Thu Nov 03, 2016 8:08 am    Post subject: Reply with quote

@DB, yes I noticed I couldn't get it work as good as I wanted, so instead just updated form width/height everytime image size changed.

mgr.inz.Player, your fix is working great here (win 10 64bit), everything executed flawlessly.

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
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