max gui canvas stretching
BlitzMax Forums/BlitzMax Beginners Area/max gui canvas stretching
| ||
Can you not stretch a canvas like you could in B+? I am setting the layout with Canvas.SetLayout 1, 1, 1, 1 and it becomes all garbled with the render remaining unscaled. I am using the D3D7Max2DDriver. |
| ||
edit: I used this method (for displaying images which fit in the window) but I'm sure there is a better alternative .. (NOTE: The canvas is also set to 1,1,1,1 layout) If EventID()=EVENT_GADGETPAINT SetGraphics CanvasGraphics(canvas) SetViewport 0,0,canvas.Width,canvas.Height Cls Local sx#=Float(canvas.ClientWidth())/Float(img.Width) Local sy#=Float(canvas.ClientHeight())/Float(img.Height) SetScale sx,sy DrawImage img,0,0 Flip EndIf Full example: |
| ||
I can't believe this isn't handled automatically. Thanks for your help. |
| ||
I have the exact same problem. |