public AddNewRect ( int x, int y, int w, int h ) : void | ||
x | int | |
y | int | |
w | int | |
h | int | |
Résultat | void |
void menuModule_menuItemClick(object sender, MenuItemClickEventArgs e) { switch (e.MenuName) { case "Rect": { //create rect from spec dzBoardModule.AddNewRect(0, 0, 50, 50); } break; case "Box": { dzBoardModule.AddNewBox(20, 20, 50, 50); } break; case "Text": { } break; case "Image": { //load image //Image img = viewport.P.CreatePlatformBitmap( //dzBoardModule.AddNewImageBox(20, 20, 100, 50); ImageBinder imgBinder = LoadImage("../../Demo/favorites32.png"); var holder = dzBoardModule.AddNewImageBox(20, 20, 50, 50, imgBinder); holder.SetSerializeDelegate(SerializeDzImageBox); holder.SetCloneDelegate(CloneImageBox); } break; } }
public void DrawContents(DesignBoardModule dzBoard) { //write content to the viewport var rootdoc = xmldoc.DocumentElement; foreach (var childnode in rootdoc.ChildNodes) { var elemNode = childnode as XmlElement; if (elemNode == null) { continue; } //create element int left, top, width, height; switch (elemNode.Name) { case "rectbox": { //create rect box and add to viewport GetDimensionAttr(elemNode, out left, out top, out width, out height); dzBoard.AddNewBox(left, top, width, height); } break; case "shapebox": { GetDimensionAttr(elemNode, out left, out top, out width, out height); dzBoard.AddNewRect(left, top, width, height); } break; case "textbox": { } break; default: { } break; } } }
public void DrawContents(DesignBoardModule dzBoard) { //write content to the viewport var rootdoc = xmldoc.DocumentElement; foreach (var childnode in rootdoc.ChildNodes) { var elemNode = childnode as XmlElement; if (elemNode == null) { continue; } //create element int left, top, width, height; switch (elemNode.Name) { case "rectbox": { //create rect box and add to viewport GetDimensionAttr(elemNode, out left, out top, out width, out height); dzBoard.AddNewBox(left, top, width, height); } break; case "shapebox": { GetDimensionAttr(elemNode, out left, out top, out width, out height); dzBoard.AddNewRect(left, top, width, height); } break; case "textbox": { } break; default: { } break; } } }