Вот по быстрому накидал.. но поленился сообразить как смещения посчитать чтобы вращать вокруг нужной точки..
//---------------------------------------------------------------------------
//----------------------------------
// настройка среды для GdiPlus
#define STRICT
#pragma option -w-hid
#include
#include
using std::min;
using std::max;
#include
#pragma comment(lib, "GdiPlus.lib") // для статик линковки
#pragma option -whid
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
//---------------------------------------------------------------------------
#include
...
void __fastcall TForm11::FormCreate(TObject *Sender)
{
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
}
//---------------------------------------------------------------------------
void __fastcall TForm11::FormDestroy(TObject *Sender)
{
Gdiplus::GdiplusShutdown(gdiplusToken);
}
//---------------------------------------------------------------------------
void __fastcall TForm11::PrepareBackground()
{
// фон из файла
Gdiplus::Bitmap pict(L"1.bmp");
// стрелка из файла
Gdiplus::Bitmap arrow(L"2.png");
// там будем выводить результат
Gdiplus::Graphics dest(this->Handle);
// буфер в котором перемасштабированная картинка из файла
Gdiplus::Bitmap *sour = new Gdiplus::Bitmap(Width, Height, PixelFormat32bppPARGB);
Gdiplus::Graphics temp(sour);
temp.SetSmoothingMode(Gdiplus::SmoothingModeHighQuality);
temp.ResetTransform ();
temp.DrawImage(&pict, 0, 0, Width, Height);
float dx = arrow.GetWidth()/2 *cos(angle*3.14/180);
float dy = 0;//(arrow.GetHeight()-9);//*sin(angle*3.14/180);
temp.TranslateTransform (100-dx, 100+dy);
temp.RotateTransform(angle);
temp.DrawImage(&arrow, 0, 0, arrow.GetWidth(), arrow.GetHeight());
temp.ResetTransform();
Gdiplus::Pen pen(Gdiplus::Color(255, 0, 0, 255));
temp.DrawLine(&pen, 100, 0, 100, 200);
temp.DrawLine(&pen, 0, 100, 200, 100);
dest.DrawImage(sour, Gdiplus::PointF(0,0));
Caption = angle;
}
void __fastcall TForm11::Timer1Timer(TObject *Sender)
{
Timer1->Enabled = false;
PrepareBackground();
angle += 10;
if (angle > 360)
angle = 0;
Timer1->Enabled = true;
}