Currently, the gradient brush is dependent on what’ll be paint after it’s created. It’s like a chicken&egg problem here.
I would like to create a gradient brush, let say from (10%,10%) to (60%,60%) of the size of what will be painted afterward but I can’t with current code.
This mean that I must know the size I’ll be drawing to create the gradient before actually starting drawing anything.
As it’s user code that will control the drawing code, I can’t create the gradient.
I wonder if it would be possible to add a case to current GradientBrush to let it create the gradient only when first used, with relative value (like percent or a destination’s width&height ratio) ?