UseGDIPlus killing my timer

I have a Canvas that scrolls across the Window. (The whole canvas not words in the canvas). Using the timer it goes very smoothly from one side to the other. I decided I wanted a picture to measure StringWidth somewhere else in the project, so
App Open event UseGDIPlus = True

Now the canvas scrolling across the Window looks like something from a Pet Commodor circa 1980.

Any way to not have this happen? I guess use the depreciated NewPicture instead of New Picture?

RB2012 r2

Thanks.

I’m not clear why you feel the need to turn UseGDIPlus to true. This shouldn’t be necessary for what you’re trying to accomplish.

Ah I see if I include Depth I can still use New Picture. So problem solved for this project, but not solved for projects that I will need an Alpha channel for and a timer.

If you specify a depth of 24 or 32, you’ll get a picture with an mask. This is not connected to the UseGDIPlus, at least according to the documentation.

If you don’t specify a depth you’ll get a picture with an alpha channel instead of a mask. Under Windows, UseGDIPlus must be True to create a picture with an alpha channel.

Yes, but that’s not a fix for the way things happen when I have alpha channel + a timer to move pictures around.

I was clarifying Eric Williams’ post rather than making a suggestion. Your original post makes it sound like you’re moving a canvas control around a window, which is not recommended (due to performance problems and flickering.)

So, basically, you’re creating a transparent canvas control that you move around using a timer. Presumably, there is something behind the canvas control that you want to remain visible.

Perhaps you could just make the canvas control as large as necessary and use the timer to move the elements that are drawn inside it.