Does anyone know why Canvas Graphics DrawOval & DrawRect Broke in Windows. It works in Xojo 2015r4 and older Xojo 2016 and Newer it’s broke. Is there a Canvas syntax code change. Instead of drawing a Rect or Oval it reduces the diameter from the Pen width and Height. The Xojo Build it works best for Windows is Xojo2015r3.1 making me only use this Build.
Sorry I forgot to tell what pBuffer is. Yes I’m drawing from the outside the Canvas. The PBuffer is a Picture Property in the Canvas Class that holds the the backdrop picture and the graphics before it’s drawn from the DrawClassObjects Method in the Canvas Class
Self.Graphics.DrawPicture(PBuffer, X, Y, Width, Height, X, Y, Width, Height)
I learned this is from Eugene Dakin Program the Canvas Control pdf Book.
Below is an example with your code that works in Xojo 2017 r1 which updates the picture outside of the Canvas and manually double-buffers the Canvas. CanvasOval.xojo_binary_project
This is no longer valid (for several years now). Use the g as Graphics variable that is passed into the Paint event. It might be (wild speculation here) that with the switch of graphics engines on Windows, this code no longer works as well as it once did.
Try
g.DrawPicture(PBuffer, X, Y, Width, Height, X, Y, Width, Height)
You guys are awesome and thanks for your help. I’ll share the results to see if it fixed it. Thanks for the code update Eugene.
I’ll make the update the g as graphic too.
My code I used is closest to your book code examples:
Code 130. Example 7-1: CustomCanvas DrawClassObjects Method
Code 333. Example 10-2: CanvasButton Open Event