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   |
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? 
thank you
[Updated on: Mon, 10 May 2010 10:47] Report message to a moderator
|
|
|
 |
|
TopWindow content to image
By: qwerty on Fri, 07 May 2010 10:53
|
 |
|
Re: TopWindow content to image
By: mirek on Fri, 07 May 2010 14:42
|
 |
|
Re: TopWindow content to image
By: qwerty on Fri, 07 May 2010 16:02
|
 |
|
Re: TopWindow content to image
By: mirek on Mon, 10 May 2010 08:01
|
 |
|
Re: TopWindow content to image
By: qwerty on Mon, 10 May 2010 10:46
|
 |
|
Re: TopWindow content to image
By: mirek on Mon, 10 May 2010 10:54
|
 |
|
Re: TopWindow content to image
By: qwerty on Mon, 10 May 2010 12:00
|
 |
|
Re: TopWindow content to image
By: koldo on Mon, 10 May 2010 13:04
|
 |
|
Re: TopWindow content to image
By: mirek on Mon, 10 May 2010 13:26
|
 |
|
Re: TopWindow content to image
By: qwerty on Fri, 14 May 2010 08:41
|
 |
|
Re: TopWindow content to image
By: qwerty on Tue, 18 May 2010 11:23
|
Goto Forum:
Current Time: Sat Apr 26 09:46:35 CEST 2025
Total time taken to generate the page: 0.02847 seconds
|