69 auto image_size = image->GetSize();
70 auto hSlices = InitSlices(0, center.GetLeft(), center.GetRight(),
71 image_size.width, dst.GetLeft(), dst.GetRight());
72 auto vSlices = InitSlices(0, center.GetTop(), center.GetBottom(),
73 image_size.height, dst.GetTop(), dst.GetBottom());
75 for (
size_t yi = 0; yi < vSlices.size(); yi += 4) {
76 auto srcY0 = vSlices[yi];
77 auto dstY0 = vSlices[yi + 1];
78 auto srcY1 = vSlices[yi + 2];
79 auto dstY1 = vSlices[yi + 3];
80 for (
size_t xi = 0; xi < hSlices.size(); xi += 4) {
81 auto srcX0 = hSlices[xi];
82 auto dstX0 = hSlices[xi + 1];
83 auto srcX1 = hSlices[xi + 2];
84 auto dstX1 = hSlices[xi + 3];
87 canvas->DrawImageRect(image,
Rect::MakeLTRB(srcX0, srcY0, srcX1, srcY1),
@ kStrict
Sample only within the source rectangle. May be slower.
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)