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 


Resizing Canvas size

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

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Jun 05, 2016 11:21 pm    Post subject: Resizing Canvas size Reply with quote

How can I change my image object canvas size?
Doing the following will not change it
Code:

f = createForm();
object = createImage(f);
object.Width = 100;
processMessages()
print(object.Width,object.Canvas.Width); --> 100 0
object.Width = 200;
object.Canvas.Width = 200;
processMessages()
print(object.Width,object.Canvas.Width); --> 200 100
object.Picture.Bitmap.Canvas.Width = 200;
processMessages()
print(object.Width,object.Picture.Bitmap.Canvas.Width); -->200 100;

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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: Mon Jun 06, 2016 3:39 am    Post subject: Reply with quote

you need to write to/access the canvas for it to update.

writing a single pixel to it should usually update it

_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Mon Jun 06, 2016 11:55 am    Post subject: Reply with quote

Dark Byte wrote:
you need to write to/access the canvas for it to update.

writing a single pixel to it should usually update it

Well, drawing doesn't update the canvas height/width.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Wed Jun 08, 2016 4:31 am    Post subject: Reply with quote

Code:
f = createForm()
object = createImage(f)
object.Width = 200
object.Height = 200

object.Canvas.getPixel(0,0)

print(object.Canvas.Width, object.Canvas.Height)    --   200 200

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

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Jun 08, 2016 2:00 pm    Post subject: Reply with quote

mgr.inz.Player, I'm trying to resize the canvas size, not get canvas size.

For example if my image object width/height are 200/200 and I resize it to 400/400, my image canvas width/height remain 200/200 and do not change to 400/400.


Code:
f = createForm()
object = createImage(f)
object.Width = 200
object.Height = 200

object.Canvas.getPixel(0,0)

print(object.width,object.height,object.Canvas.Width, object.Canvas.Height)    --  200 200 200 200

object.height = 400;
object.width = 400;

object.Canvas.getPixel(0,0)

print(object.width,object.height,object.Canvas.Width, object.Canvas.Height)    --  400 400 200 200

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Wed Jun 08, 2016 3:21 pm    Post subject: Reply with quote

Code:
f = createForm()
image = createImage(f)

image.Width = 100
image.Height = 101

image.Canvas.getPixel(0,0)

print(image.Width,image.Height,image.Canvas.Width, image.Canvas.Height)

image.Width = 200;
image.Height = 201;
image.Picture.Bitmap.Width = 200
image.Picture.Bitmap.Height = 201

image.Canvas.getPixel(0,0)

print(image.Width,image.Height,image.Canvas.Width, image.Canvas.Height)

_________________
Back to top
View user's profile Send private message MSN Messenger
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