View previous topic :: View next topic |
Author |
Message |
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Sun Jun 05, 2016 11:21 pm Post subject: Resizing Canvas size |
|
|
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;
|
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Mon Jun 06, 2016 3:39 am Post subject: |
|
|
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 |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Mon Jun 06, 2016 11:55 am Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Jun 08, 2016 4:31 am Post subject: |
|
|
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 |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Wed Jun 08, 2016 2:00 pm Post subject: |
|
|
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 |
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Jun 08, 2016 3:21 pm Post subject: |
|
|
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 |
|
|
|