Old Graphics / NewPicture replacement

I am trying out some code that was written by KAtkoSoft but it uses the following commands which will not compile under the latest release of Xojo. Can someone tell me what the current replacement is for these. Thanks

Dim g As Graphics = Self.Graphics
P = NewPicture(16,16,32)

p = new picture (16, 16,32)

Dim g As Graphics = Self.Graphics

depending on where and how it is used, it may require a bit more engineering, if SELF is a CANVAS control…

[quote=439530:@Nathan Wright]I am trying out some code that was written by KAtkoSoft but it uses the following commands which will not compile under the latest release of Xojo. Can someone tell me what the current replacement is for these. Thanks

Dim g As Graphics = Self.Graphics
P = NewPicture(16,16,32)

That is my code… P = New Picture(16,16) Should work

As for grabbing the graphics object, it was probably only to measure text instead of creating new picture and assigning the properties… That was a common thing to do back in the day…

PM with the details and I likely can fix it…

  • Karen

Hi Karen, I have downloaded the demo to try and the module itself works great, it is just the demos that have the errors.

Are you planning on updating it to bring it up to date with the latest version of Xojo as I want to buy it as I am going to use it in my project.

Thanks

Nathan

Hi Nathan,

Ah the listbox stuff!

I updated the demos awhile aback but but never got around to uploading it… I can’t upload it right now but if PM me with your email I can send you the version with the updated demos.

As to the classes themselves, I added certain features needed for this that Xojo did not support at the time I originally wrote it, but now does, though not always the same way… As long as you do things the way I documented I’m my classes it should work fine.

As to the future, as long the classes themselves work i don’t plan on making any changes. If they break in a future version of Xojo, I will do the best I can to get them working again, but as they are actually subclasses of the Xojo Listbox, if Xojo makes a major change that breaks things, I can’t guarantee i will be able to fix it.

While I have had to make a few minor changes over time due to Xojo releases, the code has basically worked for the last 9 years.

  • karen

[quote=439536:@Dave S] Dim g As Graphics = Self.Graphics
depending on where and how it is used, it may require a bit more engineering, if SELF is a CANVAS control…[/quote]

No… It was just grabbing a graphic object to measure text… Could have done it with a picture but back when I first wrote the demos, that was common practice in a lot RB code I saw.

-Karen