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 » TopWindow content to image
Re: TopWindow content to image [message #26533 is a reply to message #26530] Mon, 10 May 2010 10:46 Go to previous messageGo to previous message
qwerty is currently offline  qwerty
Messages: 130
Registered: May 2006
Experienced Member
class SegImage_t {
public:
	Image img;
        ...

	SegImage_t(String fn, byte B_) : B(B_) {
                ...
		img = StreamRaster::LoadFileAny(~fn);
                ...
	}
};


class SegItem : public Ctrl {
	typedef SegItem CLASSNAME;

	WithPropsLay<TopWindow> propsWin;

public:
	q* owner;

        ...

	Array<SegImage_t> segs;
	SegItem(String fn, int id, q* owner);

        ...

        void Paint(Draw& w) {
                ...

        	w.DrawImage(GetSize(), back);
	        for(int i = 0; i < segs.GetCount(); ++i) {
			w.DrawImage(GetSize(), segs[i].img);
		}

                ...
        };



class q : public TopWindow {
private:
	typedef q CLASSNAME;

	WithOptLay<TopWindow> optWin;

public:

	Array<SegItem> segitems;
	SegItem*       segitem;

        ...

        void Paint(Draw& w) {
                paint(w);
        }

        paint(Draw& w) {
	        w.DrawRect(GetSize(), Black);

                ...

        	for(int s = 0; s < segitem.segs.GetCount(); ++s) {
                    segitem.SetRect(
			x, y,
			segitem.segs[s].img.GetWidth (),
			segitem.segs[s].img.GetHeight()
		);
 
                ...

	}

        void rs32Proc() {

                ...

                Refresh();
        }

        Print() {
                // ...simplified...

                PrinterJob pj;

	        pj.Landscape();

                Draw& w = pj;
                w.StartPage();

                paint(w);
	       
                w.EndPage();
        }


        q() {
                ...
                
                SetTimeCallback(REFRESH_TIME, THISBACK(rs232Proc));

        }
};



when I try to print it, all the SegItems is in left-top corner. In real, they have differrent coordinates. Can make some custom print routine, but why to separate? Smile

thank you

[Updated on: Mon, 10 May 2010 10:47]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Access Animated GIF ??
Next Topic: Image: Rescale proportional propose:
Goto Forum:
  


Current Time: Tue May 07 21:03:18 CEST 2024

Total time taken to generate the page: 0.02474 seconds