void LookAndFeelEx::drawImageSquare(Graphics& g, Image images[9], int x, int y, int width, int height)
{
#if WUSIK_8000
if (resampleImages)
{
Image xg(Image::PixelFormat::ARGB, width, height, true);
Graphics gg(xg);
if (skinTiled)
{
gg.setTiledImageFill(images[4], images[3].getWidth(), images[1].getHeight(), 1.0f);
gg.fillRect(images[3].getWidth() - offSets[0], images[1].getHeight() - offSets[0], width + offSets[1] - images[3].getWidth() - images[5].getWidth(), height + offSets[1] - images[1].getHeight() - images[7].getHeight());
gg.setTiledImageFill(images[1], images[0].getWidth(), 0, 1.0f);
gg.fillRect(images[0].getWidth() - offSets[0], 0, width + offSets[1] - images[0].getWidth() - images[2].getWidth(), images[1].getHeight());
gg.setTiledImageFill(images[7], images[6].getWidth(), height - images[7].getHeight(), 1.0f);
gg.fillRect(images[0].getWidth() - offSets[0], height - images[7].getHeight(), width + offSets[1] - images[6].getWidth() - images[8].getWidth(), images[7].getHeight());
gg.setTiledImageFill(images[3], 0, images[0].getHeight(), 1.0f);
gg.fillRect(0, images[0].getHeight() - offSets[0], images[3].getWidth(), height - images[0].getHeight() + offSets[1] - images[6].getHeight());
gg.setTiledImageFill(images[5], width - images[5].getWidth(), 0, 1.0f);
gg.fillRect(width - images[5].getWidth(), images[2].getHeight() - offSets[0], images[5].getWidth(), height + offSets[1] - images[2].getHeight() - images[8].getHeight());
}
else
{
gg.drawImage(images[4], images[3].getWidth() - offSets[0], images[1].getHeight() - offSets[0], width + offSets[1] - images[3].getWidth() - images[5].getWidth(), height + offSets[1] - images[1].getHeight() - images[7].getHeight(), 0, 0, images[4].getWidth(), images[4].getHeight());
gg.drawImage(images[1], images[0].getWidth() - offSets[0], 0, width + offSets[1] - images[0].getWidth() - images[2].getWidth(), images[1].getHeight(), 0, 0, images[1].getWidth(), images[1].getHeight());
gg.drawImage(images[7], images[0].getWidth() - offSets[0], height - images[7].getHeight(), width + offSets[1] - images[6].getWidth() - images[8].getWidth(), images[7].getHeight(), 0, 0, images[7].getWidth(), images[7].getHeight());
gg.drawImage(images[3], 0, images[0].getHeight() - offSets[0], images[3].getWidth(), height - images[0].getHeight() + offSets[1] - images[6].getHeight(), 0, 0, images[3].getWidth(), images[3].getHeight());
gg.drawImage(images[5], width - images[5].getWidth(), images[2].getHeight() - offSets[0], images[5].getWidth(), height + offSets[1] - images[2].getHeight() - images[8].getHeight(), 0, 0, images[5].getWidth(), images[5].getHeight());
}
gg.drawImageAt(images[0], 0, 0);
gg.drawImageAt(images[2], width - images[2].getWidth(), 0);
gg.drawImageAt(images[6], 0, height - images[6].getHeight());
gg.drawImageAt(images[8], width - images[8].getWidth(), height - images[8].getHeight());
g.drawImageAt(xg, x, y);
}
else
{
#endif
//
if (skinTiled)
{
g.setTiledImageFill(images[4], x + images[3].getWidth(), y + images[1].getHeight(), 1.0f);
g.fillRect(x + images[3].getWidth(), y + images[1].getHeight(), width - images[3].getWidth() - images[5].getWidth(), height - images[1].getHeight() - images[7].getHeight());
g.setTiledImageFill(images[1], x + images[0].getWidth(), y, 1.0f);
g.fillRect(x + images[0].getWidth(), y, width - images[0].getWidth() - images[2].getWidth(), images[1].getHeight());
g.setTiledImageFill(images[7], x + images[6].getWidth(), y + height - images[7].getHeight(), 1.0f);
g.fillRect(x + images[6].getWidth(), y + height - images[7].getHeight(), width - images[6].getWidth() - images[8].getWidth(), images[7].getHeight());
g.setTiledImageFill(images[3], x, y + images[0].getHeight(), 1.0f);
g.fillRect(x, y + images[0].getHeight(), images[3].getWidth(), height - images[0].getHeight() - images[6].getHeight());
g.setTiledImageFill(images[5], x + width - images[5].getWidth(), y, 1.0f);
g.fillRect(x + width - images[5].getWidth(), y + images[2].getHeight(), images[5].getWidth(), height - images[2].getHeight() - images[8].getHeight());
}
else
{
g.drawImage(images[4], x + images[3].getWidth() - offSets[0], y + images[1].getHeight() - offSets[0], width + offSets[1] - images[3].getWidth() - images[5].getWidth(), height + offSets[1] - images[1].getHeight() - images[7].getHeight(), 0, 0, images[4].getWidth(), images[4].getHeight());
g.drawImage(images[1], x + images[0].getWidth() - offSets[0], y, width + offSets[1] - images[0].getWidth() - images[2].getWidth(), images[1].getHeight(), 0, 0, images[1].getWidth(), images[1].getHeight());
g.drawImage(images[7], x + images[0].getWidth() - offSets[0], y + height - images[7].getHeight(), width + offSets[1] - images[6].getWidth() - images[8].getWidth(), images[7].getHeight(), 0, 0, images[7].getWidth(), images[7].getHeight());
g.drawImage(images[3], x, y + images[0].getHeight() - offSets[0], images[3].getWidth(), height - images[0].getHeight() + offSets[1] - images[6].getHeight(), 0, 0, images[3].getWidth(), images[3].getHeight());
g.drawImage(images[5], x + width - images[5].getWidth(), y + images[2].getHeight() - offSets[0], images[5].getWidth(), height + offSets[1] - images[2].getHeight() - images[8].getHeight(), 0, 0, images[5].getWidth(), images[5].getHeight());
}
g.drawImageAt(images[0], x, y);
g.drawImageAt(images[2], x + width - images[2].getWidth(), y);
g.drawImageAt(images[6], x, y + height - images[6].getHeight());
g.drawImageAt(images[8], x + width - images[8].getWidth(), y + height - images[8].getHeight());
//
#if WUSIK_8000
}
#endif
}