Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) DrawGlobePlus

 

DrawGlobePlus is a VCL graphics code snippet to draw a globe with a plus on it.

 

DrawGlobePlus assumes that you have already defined the DrawGlobe function.

 

#include <ExtCtrls.hpp>

//From http://www.richelbilderbeek.nl/CppDrawGlobePlus.htm
void DrawGlobePlus(
  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);
  image->Canvas->MoveTo(width / 2,1 * height / 4);
  image->Canvas->LineTo(width / 2,3 * height / 4);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml