Is this book on the Canvas Control still valid for Xojo?

Book on Canvas Control circa 2014 by Eugene Dakin
Program the Canvas Control with Xojo Desktop (RBL-0053)
By xDev Magazine

I haven’t touched the canvas control and This book was written in 2014.
Does anyone know if it Will it still be relevant ?

I suppose so (no major changes since then was done on the Canvas).

And Eugene revise (rewrote, add stuff, etc.) regularly on his books.

Thanks Emile

[quote=427061:@Emile Schwarz]I suppose so (no major changes since then was done on the Canvas).

And Eugene revise (rewrote, add stuff, etc.) regularly on his books.[/quote]
Except that:
0. You can no longer access the Graphics object from outside of the Paint event.
0. Graphics coordinates are now Doubles instead of Integers.
0. On macOS 10.14, some of the color methods like FillColor return different values depending on whether the user’s system is set to light or dark mode.
0. On Windows, we now use hardware accelerated Direct2D which may result in subtle drawing differences.

I’m sure there are others, but I can’t remember off the top of my head.

Eugene, Help !

Hi James,

The good news is that the book is still relevant, and is not perfect. I picked a couple random examples from each chapter and most of them run on Xojo 2018 r.4. The logic is explained in the book is correct and there has been some nice upgrades to the Xojo language since 2014 that Greg has mentioned.

Could the book use an upgrade? Yes.
Is most of the code working and usuable? Yes.
Could the code in the book be tweaked for higher performance? Yes
Does every example work in Xojo 2018 r4? No, and most do work in 2018 r4.

As for an update of the book, I’ll put this on my ‘to do’ list. I am not sure when I will be getting the update done, as there are lots of exciting things happening.

Great question James.

Side note (thanks Eugene for the explanations):

Dot 1 of Greg answer:

This is true, but if you were here at the time, this programming way was already deprecated and if you followed the trend (do not use a deprecated use of g / Canvas’ Graphics), you are not impacted with this change.

Integer vs Doubles: either I do not noticed that or I forgot it. Sorry. (That said, in DrawPicture, I already use doubles since the first Elvis 78 rpm from Sun)… :wink:

For the other dots (and probably the missing ones), I am quite sure that a few creative programming (*) will allow you to do the job.

(*): and in all cases, a question here ill lead to a correct answer !

brilliant
thanks for the update everyone.
and cheers Eugene
Ill get the book