Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Graphics code snippet to d raws a globe with a minus on it.
Assumes that you have already defined the DrawGlobe function.
* View the code of 'DrawGlobeMinus' in plain text.
#include <ExtCtrls.hpp>
//From http://www.richelbilderbeek.nl/CppDrawGlobeMinus.htm
void DrawGlobeMinus(TImage * const image,
const unsigned char red,
const unsigned char green,
const unsigned char blue)
{
DrawGlobe(image,red,green,blue);
const int height = image->Picture->Bitmap->Height;
const int width = image->Picture->Bitmap->Width;
image->Canvas->Pen->Width = height / 10;
image->Canvas->Pen->Color = static_cast<TColor>(RGB(red,green,blue));
image->Canvas->MoveTo(1 * width / 4,height / 2);
image->Canvas->LineTo(3 * width / 4,height / 2);
}
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.