[code]
#include "stdafx.h"
#include <tchar.h>
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
__gc public class Grafika : public Form
{
public:
Grafika(void)
{
//form back color
this->BackColor = Color::Black;
this->WindowState = FormWindowState::Maximized;
//podesi cetkice
br1 = new SolidBrush(Color::White);
//podesi Point
p1.X = 10; p1.Y = 10;
//timer...
tmVreme = new Timer(); tmVreme->Interval = 10;
tmVreme->Tick += new EventHandler( this, Crtaj);
tmVreme->Start();
}
private:
Timer *tmVreme;
SolidBrush *br1;
//pozicija pravougaonika
Point p1;
void Crtaj(Object *ps, EventArgs *pe)
{
Graphics *gc = this->CreateGraphics();
gc->Clear(Color::Black);
gc->FillEllipse(br1, p1.X, p1.Y, 120, 120);
p1.X += 1; p1.Y += 1;
}
};
int _stdcall WinMain(void)
{
Application::Run( new Grafika());
return 0;
}
[code]
Kod se prevede i radi sve ok ali...
Krug koji se kreće po ekranu "trepuće" i ja ne znam kako da izvedem da se to ne događa, i da li je uopšte moguće to izvesti preko GDI+?