public void AddScrap(ScrapBaseInfo pInfo, bool pIsFirstInit = false) { ScrapBase newScrap = new ScrapBase(); newScrap.addScrapStyleEvent(this._mainform); newScrap.addScrapMenuEvent(this._mainform); if (!string.IsNullOrEmpty(pInfo.name)) { newScrap.Name = pInfo.name; } newScrap.Image = pInfo.image; newScrap.cacheInfo = pInfo; newScrap.SetBounds(0, 0, pInfo.imageWidth, pInfo.imageHeight, BoundsSpecified.All); var style = this._mainform.optSetuna.FindStyle(pInfo.styleID); if (style != null) { newScrap.isFirstInitCompactScrap = pIsFirstInit; style.Apply(ref newScrap, pInfo.stylePoint); } newScrap.Left = pInfo.posX; newScrap.Top = pInfo.posY; newScrap.Refresh(); newScrap.Show(); if (!pIsFirstInit) { newScrap.ApplyCache(); } this.AddScrap(newScrap, pInfo); }
public void AddScrap(Image img, int x, int y, int width, int height, string scrapname, string pGuid = null) { ScrapBase newScrap = new ScrapBase(); newScrap.addScrapStyleEvent(this._mainform); newScrap.addScrapMenuEvent(this._mainform); if (scrapname != "") { newScrap.Name = scrapname; } newScrap.Image = img; newScrap.SaveImg(img, pGuid); newScrap.SetBounds(x, y, img.Width, img.Height, BoundsSpecified.All); newScrap.Refresh(); newScrap.Show(); this.AddScrap(newScrap); }