Resizing a canvas

BlitzPlus Forums/BlitzPlus Programming/Resizing a canvas

Rimmsy(Posted 2004) [#1]
I use setGadgetLayout to resize a canvas with a new width and height, but instead of actually changing the resolution of the canvas, it just scales and blurs it. This can be seen when using graphics 640,480,0,(3) and resizing the window.

Any way around this?


TeraBit(Posted 2004) [#2]
On resize you'll need to create another canvas and copy the content of the first one to the second. Then free the first one.


CS_TBL(Posted 2004) [#3]
Or create a panel, put a large canvas (the biggest one you intend to use for your app) on the panel, and resize the panel ... ^^;


Rimmsy(Posted 2004) [#4]
hmm, I thought that might be the case. Weird though. Is it slow?


Kevin_(Posted 2004) [#5]
CS_TBL's solution is a good one which I also use.

First, get the width & height of the users desktop and make a canvas the same size. Then when required, just show a portion of it to whatever dimensions you require. This stops the blurring effect and you dont need to create another canvas.

It works for me.


Rimmsy(Posted 2004) [#6]
ok, thanks.