Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
UppHub
Status & Roadmap
FAQ
Authors & License
Forums
Funding U++
Search on this site











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

Color

 

Paints text using different colors

 

 

 

Color.h

 

#ifndef _Color_Color_h

#define _Color_Color_h

 

#include <CtrlLib/CtrlLib.h>

 

using namespace Upp;

 

class ColorWindow : public TopWindow {

public:

    typedef Color CLASSNAME;

    ColorWindow();

 

    virtual void Paint(Draw& draw);

};

 

#endif

 

 

 

main.cpp

 

#include "Color.h"

 

ColorWindow::ColorWindow()

{

    Sizeable().Zoomable();

}

 

void ColorWindow::Paint(Draw& draw)

{

    draw.DrawRect(GetSize(), White());

    for(int i = 0; i < 16; i++) {

        Color c(i & 1 ? 255 : 0, i & 2 ? 255 : 0, i & 4 ? 255 : 0);

        draw.DrawText(0, i * 30, AsString(c), Arial(30).Underline(), c);

    }

}

 

GUI_APP_MAIN

{

    ColorWindow().Run();

}

 

 

 

 

Do you want to contribute?