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












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Strange issue with text in Painter
Re: Strange issue with text in Painter [message #50963 is a reply to message #50962] Tue, 15 January 2019 09:53 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 12571
Registered: November 2005
Ultimate Member
BTW, here is my testing code where I am trying to reproduce the issue:

#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>

using namespace Upp;

class PainterText : public TopWindow {
public:
	Painting p;
	FileSel fs;
	BufferPainter bpainter;
	double scale = 0.4;
	int    rotation = 0;
	Pointf translate = Pointf(0, 0);
	Pointf start;
	
	void Open(){
		if(fs.ExecuteOpen("Select a painting to view")) {
			p.Clear();
			p.Serialize(FileIn(fs.Get()));
		}
	}
	
	virtual void LeftDown(Point p, dword)
	{
		start = (Pointf)p * scale;
		SetCapture();
	}

	virtual void MouseMove(Point p, dword keyflags)
	{
		if(HasCapture()) {
			Pointf pos = (Pointf)p * scale;
			translate += (pos - start);
			start = pos;
			Refresh();
		}
	}

	virtual void MouseWheel(Point p, int zdelta, dword keyflags)
	{
		if(keyflags & K_CTRL)
			rotation += sgn(zdelta);
		else {
			if(zdelta < 0)
				scale *= 0.9;
			else
				scale /= 0.9;
		}
		Refresh();
	}


	virtual bool Key(dword key, int count){
		Refresh();
		switch(key){
			case K_CTRL_O:
				Open();
				return true;
		}
		return false;
	}
	
	typedef PainterText CLASSNAME;

	PainterText(){
		Sizeable();

		p.Serialize(FileIn("C:/xxx/PainteTest/T5.painting"));
	}
		
	virtual void Paint(Draw &draw){
		ImageBuffer ib(GetSize());
		{
			bpainter.Create(ib);
			bpainter.Co(true);
			bpainter.PreClipDashed();
			bpainter.Clear(White());
			bpainter.EvenOdd();
			
			bpainter.Scale(scale);
			bpainter.Rotate(rotation * .1);
			bpainter.Translate(translate);
			
			bpainter.Paint(p);

			bpainter.Finish();
		}
		
		SetSurface(draw,Rect(ib.GetSize()),ib,ib.GetSize(),Point(0,0));
	}
};

GUI_APP_MAIN
{
	PainterText().Run();
}


Perhaps you could try with the painting file you have produced - this is to ensure that I am doing the same thing...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MT + Subpixel appear incompatible in Painter
Next Topic: Painter: Excessive memory usage in PainterExamples moving window to edges of screen.
Goto Forum:
  


Current Time: Tue Jul 07 08:06:50 CEST 2020

Total time taken to generate the page: 0.01958 seconds