Canvas size limited to 1024x768 ?

BlitzMax Forums/BlitzMax Beginners Area/Canvas size limited to 1024x768 ?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Try this (scrollbars)
Const WWX = 800
Const WWY = 600

Const W = 1024 'not work with 2048x1024 !
Const H = 768

Local window:TGadget=CreateWindow("",0,0,WWX,WWY, Null, WINDOW_MENU|WINDOW_TITLEBAR)

Local panel:Tgadget = CreatePanel(10,10,WWX-40,WWY-80,window,PANEL_ACTIVE)
SetGadgetLayout panel,1,1,1,1
SetPanelColor panel,100,0,200

Local sv:Tgadget = CreateSlider(WWX-30,10,20,WWY-80,window,SLIDER_VERTICAL)
Local sh:Tgadget = CreateSlider(10,WWY-70,WWX-40,20,window,SLIDER_HORIZONTAL)

Global canvas:TGadget=CreateCanvas(0,0,W,H,panel)

SetSliderRange sv,ClientWidth(panel),GadgetWidth(canvas)
SetSliderRange sh,ClientHeight(panel),GadgetHeight(canvas)

While WaitEvent()
	Select EventID()
		Case EVENT_TIMERTICK
			RedrawGadget canvas

		Case EVENT_GADGETPAINT
			SetGraphics CanvasGraphics(canvas)
			Cls
			SetColor 255,255,255
			'...
			Flip
			
			SetGadgetShape canvas,-SliderValue(sh),-SliderValue(sv),GadgetWidth(canvas),GadgetHeight(canvas)
			
			
		Case EVENT_MOUSEMOVE

			SetSliderRange sh,ClientWidth(panel),GadgetWidth(canvas)
			SetSliderRange sv,ClientHeight(panel),GadgetHeight(canvas)
			SetGadgetShape canvas,-SliderValue(sh),-SliderValue(sv),GadgetWidth(canvas),GadgetHeight(canvas)
			
			
		Case EVENT_WINDOWCLOSE
				FreeGadget canvas
				End

		Case EVENT_APPTERMINATE
			End
	End Select

	
Wend