<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by alex (mmlab) -->
<rmml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="L:\collaborative-nir\program\Cscl3DWS\rmml\RMML.xsd">
	<composition   _name="CResizablePaper">
		<image _name="lt" />	<!-- corners -->
		<image _name="ct" />
		<image _name="rt" />
		<image _name="lc" />
		<image _name="cc" />
		<image _name="rc" />
		<image _name="lb" />
		<image _name="cb" />
		<image _name="rb" />

		<script>
			function	resize(w,h)
			{
				// arrange corners
				this.rt._x = w - this.rt._width;
				this.lb._y = h - this.lb._height;
				this.rb._x = w - this.rb._width;	this.rb._y = h - this.rb._height;

				this.ct._x = this.lt._width;	this.ct._width = w - this.lt._width - this.rt._width;	// top line
				this.lc._y = this.lt._height;	this.lc._height = h - this.lt._height - this.lb._height;	// center line
				this.cc._x = this.lc._width;	this.cc._y = this.lt._height;	this.cc._width = w - this.lc._width - this.rc._width; this.cc._height = h - this.ct._height - this.cb._height;
				this.rc._y = this.rt._height;	this.rc._x = w - this.rc._width;		this.rc._height = h - this.rt._height - this.rb._height;	// center line
				this.cb._x = this.lb._width;	this.cb._y = h - this.cb._height; this.cb._width = w - this.lb._width - this.rb._width;	// bottom line
			}
			function init(src, th, lw, rw, bh)
			{
				lt.src=src; ct.src=src; rt.src=src;
				lc.src=src; cc.src=src; rc.src=src;
				lb.src=src; cb.src=src; rb.src=src;
				var width = lt.width;
				var height = lt.height;
				lt.crop(0,0, lw, th);
				ct.crop(lw, 0, width-lw-rw, th);
				rt.crop(width-rw, 0, rw, th);
				lc.crop(0, th, lw, height-th-bh);
				cc.crop(lw, th, width-lw-rw, height-th-bh);
				rc.crop(width-rw, th, rw, height-th-bh);
				lb.crop(0, height-bh, lw, bh);
				cb.crop(lw, height-bh, width-lw-rw, bh);
				rb.crop(width-rw, height-bh, rw, bh);
			}
		</script>
	</composition>
	<composition name="CResizablePaperConstH">
		<image name="l" />
		<image name="c" />
		<image name="r" />
		<script>
			function init(src, border)
			{
				l.src=src;
				var h = l.height;
				var w = l.width;
				l.crop(0, 0, border, h);
				c.src=src;
				c.crop(border, 0, w-2*border, h);
				r.src=src;
				r.crop(w-border, 0, border, h);
				l.x=0;
				c.x=border;
				r.x=w-border;
			}
			function resize(w)
			{
				c.width = w-l.width-r.width;
				r.x=l.width+c.width;	
			}
		</script>
	</composition>
		<composition name="CResizablePaperConstW">
		<image name="t" />
		<image name="c" />
		<image name="b" />
		<script>
			function init(src, border)
			{
				t.src=src;
				var h = t.height;
				var w = t.width;
				t.crop(0, 0, w, border);
				c.src=src;
				c.crop(0, border, w, h-2*border);
				b.src=src;
				b.crop(0, h-border, w, h-border);
				t.y=0;
				c.y=border;
				b.y=h-border;
			}
			function resize(h)
			{
				c.height = h-t.height-b.height;
				b.y=t.height+c.height;	
			}
		</script>
	</composition>
</rmml>
