Currently I draw images next way:
- During load, using WIC, I obtain the original bitmap, store it as a property in object, that represents an image (
ID2D1Bitmap *imageOriginalproperty). - Then (still at load time), I create compatible render target with the size I need image to be.
- Draw image to the compatible target using scale effect.
- Allocate new bitmap as property of object that represents an image (
ID2D1Bitmap *imageScaledproperty). - Copy from compatible target to
imageScaled. - Free compatible target. Here image load ends.
When already created image object need to be resized, I repeat steps 2-6. In the result, in render loop I have to only draw imageScaled.
I currently thinking about of removing 2-6 steps and just draw scale effect with imageOriginal passed from each image object in the render loop every time.
I do not know what exactly Direct2d Scale effect does. If it actually every time does something similar to steps 2-6, then, probably I don't need to do it.
In the other hand, in my render loop there is basic skip algorithm for objects that are out of parent view, so they are not drawn at all. In current realization I may need to wait time for pre scale objects that possibly out of view, and they will not be drawn currently. With Scale effect in render loop realization this problem will be solved.
Does anyone know which solution will be the fastest?