Home » Community » Newbie corner » smoother drawing
Re: smoother drawing [message #27691 is a reply to message #27682] |
Thu, 29 July 2010 16:42   |
cullam
Messages: 8 Registered: July 2010 Location: St. John's Canada
|
Promising Member |
|
|
Aha! This is looking much more promising!
So, I'm looking through the code in the example, but without any comments in it, I'm not entirely sure what I'm seeing.
Examples.h
#ifndef _PainterExamples_Examples_h_
#define _PainterExamples_Examples_h_
#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>
using namespace Upp;
#define IMAGECLASS TestImg
#define IMAGEFILE <PainterExamples/Test.iml>
#include <Draw/iml_header.h>
#define LAYOUTFILE <PainterExamples/Examples.lay>
#include <CtrlCore/lay.h>
void RegisterExample(const char *name, void (*ex)(Painter& pw));
struct App : TopWindow {
virtual void Paint(Draw& w);
SplitterFrame split;
ArrayCtrl list;
FrameBottom< WithCtrlLayout<StaticRect> > ctrl;
typedef App CLASSNAME;
void DoPaint0(Painter& sw);
void DoPaint(Painter& sw);
void Print();
void Benchmark();
void Sync();
void ToSlider(EditDouble *e, SliderCtrl *slider);
void ToEdit(EditDouble *e, SliderCtrl *slider);
void Pair(EditDouble& e, SliderCtrl& slider);
void ToSlider();
void Reset();
void Serialize(Stream& s);
App();
~App();
};
#endif
All the drawing classes in this example appear to take a reference to a Painter object, but I'm not quite sure where I get this object in the first place. In my app, my main is just:
#include "VectorsGUI.h"
#define VERSION "2010070801"
#define FILE_BASE "SQX-Drive"
#define FILE_TITLE String( FILE_BASE )
GUI_APP_MAIN
{
VectorsGUI(FILE_TITLE, FILE_BASE, VERSION ).Run();
}
... with everything of interest happening in my other classes. I believe the Paint() function I'm using came from inheriting my most important class from WithVectorsGUILayout<TopWindow>. What do I need to modify/do/include to be able to use Painter() instead? Is it some way of getting a Painter& to pass into Paint(), rather than a Draw&?
Thanks for the help. And it is very helpful to know that what I'm looking to do CAN be done simply! Now I just need to figure out how...
|
|
|
 |
|
smoother drawing
By: cullam on Thu, 29 July 2010 14:33
|
 |
|
Re: smoother drawing
By: mr_ped on Thu, 29 July 2010 15:10
|
 |
|
Re: smoother drawing
By: cullam on Thu, 29 July 2010 15:52
|
 |
|
Re: smoother drawing
By: mr_ped on Thu, 29 July 2010 16:10
|
 |
|
Re: smoother drawing
By: mr_ped on Thu, 29 July 2010 16:12
|
 |
|
Re: smoother drawing
By: mr_ped on Thu, 29 July 2010 16:27
|
 |
|
Re: smoother drawing
By: cullam on Thu, 29 July 2010 16:42
|
 |
|
Re: smoother drawing
By: mr_ped on Thu, 29 July 2010 16:56
|
 |
|
Re: smoother drawing
By: mr_ped on Thu, 29 July 2010 17:06
|
 |
|
Re: smoother drawing
By: cullam on Thu, 29 July 2010 18:11
|
 |
|
Re: smoother drawing
By: cullam on Thu, 29 July 2010 19:43
|
 |
|
Re: smoother drawing
By: mr_ped on Fri, 30 July 2010 10:08
|
 |
|
Re: smoother drawing
By: koldo on Fri, 30 July 2010 21:58
|
Goto Forum:
Current Time: Mon Apr 28 06:11:15 CEST 2025
Total time taken to generate the page: 0.01202 seconds
|