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











SourceForge.net Logo

Watermark

 

Demostrates how to add watermark image to Report

 

 

Watermark.h

 

#ifndef _Watermark_Watermark_h

#define _Watermark_Watermark_h

 

#include <CtrlLib/CtrlLib.h>

 

using namespace Upp;

 

#define LAYOUTFILE <Watermark/Watermark.lay>

#include <CtrlCore/lay.h>

 

class Watermark : public WithWatermarkLayout<TopWindow> {

public:

    typedef Watermark CLASSNAME;

    Watermark();

};

 

#endif

 

 

 

main.cpp

 

#include <Report/Report.h>

 

using namespace Upp;

 

void DrawWatermark(Report *report)

{ // Draw something to the background

    report->DrawText(1000, 1000, 3000, "Watermark", Serif(1000), WhiteGray());

}

 

GUI_APP_MAIN

{

    Report report;

    report.OnPage(callback1(DrawWatermark, &report)); // called after new page is created

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

        report << "{{1:1:1@N Report:: with:: Watermark}}"; // Need to use @N to make table background transparent

        report << "Report with Watermark";

    }

    Perform(report);

}

 

 

 

 

Do you want to contribute?