I think reusing the sample from Ajout de certaines fonctionnalité - #11 by Arcitectus would be a good start:
using Bib3.Geometrik;
static MotionParam MouseClickWithRegionSubstituted(
IUIElement destination,
RectInt region,
MouseButtonIdEnum mouseButton,
int repetitionCount = 0) =>
new MotionParam
{
MouseListWaypoint = new[] { new MotionParamMouseRegion { UIElement = destination, RegionReplacement = region, } },
MouseButton = new[] { mouseButton },
MouseButtonRepetitionCount = repetitionCount,
};
Then, to implement the reduction by 10 pixels from the right side, I would try the following code:
static MotionParam MouseClickWithRegionReducedByTenOnTheRight(
IUIElement destination,
MouseButtonIdEnum mouseButton,
int repetitionCount = 0) =>
MouseClickWithRegionSubstituted(
destination,
RectInt.FromMinPointAndMaxPoint(
destination.Region.MinPoint(),
new Vektor2DInt(destination.Region.Max0 - 10, destination.Region.Max1)),
mouseButton,
repetitionCount);