Hi, I’ve just got 6.1.3 and there’s a change to draggable objects.
It has as ScaledImage now, which I guess is for window scaling. Very useful, as I now don’t have to use the component scale factor to get a correct offset, thanks!
My question is:-
How to I set a bitmap to a ScaledImage if it’s a class variable, without having to instantiate it in code, like this:?
What’s the actual problem you’re running into? I don’t understand what you mean by “without having to instantiate it” - you’ll have to instantiate a ScaledImage in order to pass it to startDragging.
The constructor of ScaledImage takes an Image, and an optional scale factor that describes how the physical pixels in the image correspond to logical pixels.
If you have a ScaledImage member in your class, you can assign to it, like so:
Although, ImageCache keeps the image cached internally, so you might not need to keep the image as a data member at all, and can just pass the image directly to startDragging instead: