private void Btn1_Click(object sender, EventArgs e) { string ID = ((Button)sender).ID; string str_rec_id = ID.Split('_')[0]; int rec_id = int.Parse(str_rec_id); trans tr = new trans(); int test = tr.Odrzuc_Linie_transferu(str_rec_id, lb_login.Text); if (test == 0) { ((Button)sender).Enabled = false; var db = new dbtrans1DataContext(); trans srv = new trans(); Service1 srv1 = new Service1(); } if (Wizard1.ActiveStepIndex != Wizard1.WizardSteps.Count - 1) { Wizard1.ActiveStepIndex++; } else { Response.Redirect("~/potw.aspx"); } }
public void Awake() { player = GameObject.FindGameObjectWithTag("Player"); player.GetComponent <Transform>().position = startpos; cam.GetComponent <CinemachineVirtualCamera>().Follow = player.GetComponent <Transform>(); trans a = sc.GetComponent <trans>(); a.player = player; }
public static List <string> Transform(this List <Person> list, trans action) { List <string> listNew = new List <string>(); foreach (var item in list) { listNew.Add(action(item)); } return(listNew); }
void Awake() { if (roomname != "Room3") { scrSp = itSpawn.GetComponent <itemSpawn>(); } scrEx = ex.GetComponent <trans>(); /*loading*/ if (PlayerPrefs.HasKey(roomname)) { temp = PlayerPrefs.GetString(roomname); saved = JsonUtility.FromJson <Data>(temp); if (roomname != "Room3") { if (saved.openCh) { itSpawn.SetActive(false); scrSp.isEnd = true; } } foreach (GameObject i in GameObject.FindGameObjectsWithTag("quest")) { Destroy(i); } for (int i = 0; i < saved.tr.Length; i++) { if (saved.name[i].Contains("shest")) { Instantiate(shest, saved.tr[i], Quaternion.identity); } else if (saved.name[i].Contains("klu")) { Instantiate(klu, saved.tr[i], Quaternion.identity); } else if (saved.name[i].Contains("list")) { Instantiate(lis, saved.tr[i], Quaternion.identity); } else if (saved.name[i].Contains("otv")) { Instantiate(otv, saved.tr[i], Quaternion.identity); } else if (saved.name[i].Contains("key")) { Instantiate(ke, saved.tr[i], Quaternion.identity); } else if (saved.name[i].Contains("chip")) { Instantiate(chp, saved.tr[i], Quaternion.identity); } } } }
protected void Button1_Click(object sender, EventArgs e) { trans tr = new trans(); bool test = tr.Zaloguj(this.tb_login.Text, this.tb_haslo.Text); if (test) { string _token = StringUtil.Crypt(this.tb_login.Text + "#" + nr + "#" + pakowacz); Response.Redirect("~/potwl.aspx?user="******"&nr=" + nr); } }
private void Btn_Click(object sender, EventArgs e) { string ID = ((Button)sender).ID; ((Button)sender).Enabled = false; trans tr = new trans(); int test = tr.Zaksieguj_Linie_transferu(ID, lb_login.Text); if (test == 0) { ((Button)sender).Text = "Potwierdzone!"; } if (Wizard1.ActiveStepIndex != Wizard1.WizardSteps.Count - 1) { Wizard1.ActiveStepIndex++; } else { Response.Redirect("~/potw.aspx"); } }
/// <summary> /// Metoda odpowiedzialna za operacje na obrazie. /// </summary> /// <param name="prog">The prog.</param> /// <param name="RodzajTansformacji">Rodzaj filtra, który zostaje użyty w programie</param> /// <returns></returns> public unsafe Bitmap Transformacja(int prog, trans RodzajTansformacji) { /// <summary> /// Tworzenie nowego obrazu, zachowywującego parametry, wczytanego oryginalnego obrazu. /// </summary> /// <param name="nowyObrazek"> Obrazek, /// który przyjmuje parametry z wczytanego obrazu. /// Konwersja obrazu do formatu 24bppRGB</param> /// <returns></returns> nowyObrazek = new Bitmap(obrazekKopia.Width, obrazekKopia.Height, PixelFormat.Format24bppRgb); /// <summary> /// Sprawdzenie, czy wczytany obraz nie posiada formatu: /// 1. Format8bpp /// 2. Format24bpp /// </summary> if (obrazekKopia.PixelFormat != PixelFormat.Format8bppIndexed && obrazekKopia.PixelFormat != PixelFormat.Format24bppRgb) { Bitmap bmp = new Bitmap(obrazekKopia.Width, obrazekKopia.Height, PixelFormat.Format24bppRgb); Graphics g = Graphics.FromImage(bmp); g.DrawImage(obrazekKopia, 0, 0, obrazekKopia.Width, obrazekKopia.Height); g.Dispose(); obrazekKopia = bmp; obrazek = bmp; } PixelFormat formatObrazka = (obrazek.PixelFormat == PixelFormat.Format8bppIndexed) ? PixelFormat.Format8bppIndexed : PixelFormat.Format24bppRgb; BitmapData daneWyjsciowe = nowyObrazek.LockBits(new Rectangle(0, 0, obrazek.Width, obrazek.Height), ImageLockMode.ReadWrite, formatObrazka); BitmapData daneWejsciowe = obrazek.LockBits(new Rectangle(0, 0, obrazek.Width, obrazek.Height) , ImageLockMode.ReadOnly, formatObrazka); byte* wskWyjsciowe = (byte*)daneWyjsciowe.Scan0; byte* wskWejsciowe = (byte*)daneWejsciowe.Scan0; int nOffset = daneWejsciowe.Stride - obrazek.Width*3; switch (RodzajTansformacji) { case trans.JASNOSC: int nowaWartosc = 0; for (int y = 0; y < obrazekKopia.Height; y++) { for (int x = 0; x < obrazekKopia.Width * 3; x++) { nowaWartosc = (int)(wskWejsciowe[0] + prog); if (nowaWartosc < 0) nowaWartosc = 0; if (nowaWartosc > 255) nowaWartosc = 255; wskWyjsciowe[0] = (byte)nowaWartosc; wskWyjsciowe++; wskWejsciowe++; } wskWyjsciowe += nOffset; wskWejsciowe += nOffset; } break; case trans.NEGATYW: for(int y = 0; y < obrazekKopia.Height; y++) { for(int x = 0; x < obrazekKopia.Width; x++) { wskWyjsciowe[0] = (byte)(255 - wskWejsciowe[0]); wskWyjsciowe[1] = (byte)(255 - wskWejsciowe[1]); wskWyjsciowe[2] = (byte)(255 - wskWejsciowe[2]); wskWejsciowe += 3; wskWyjsciowe += 3; } wskWejsciowe += nOffset; wskWyjsciowe += nOffset; } break; case trans.SZAROSC: for(int y = 0; y < obrazekKopia.Height; y++) { for(int x = 0; x <obrazekKopia.Width; x++) { wskWyjsciowe[0] = wskWyjsciowe[1] = wskWyjsciowe[2] = (byte)((wskWejsciowe[0] + wskWejsciowe[1] + wskWejsciowe[2]) / 3); wskWejsciowe += 3; wskWyjsciowe += 3; } wskWejsciowe += nOffset; wskWyjsciowe += nOffset; } break; case trans.BINARYZACJA: for(int y = 0; y < obrazekKopia.Height; y++) { for(int x = 0; x < obrazekKopia.Width; x++) { if((wskWejsciowe[0] + wskWejsciowe[1] + wskWejsciowe[2]) / 3 < prog) { wskWyjsciowe[0] = wskWyjsciowe[1] = wskWyjsciowe[2] = 0; } else { wskWyjsciowe[0] = wskWyjsciowe[1] = wskWyjsciowe[2] = 255; } wskWejsciowe += 3; wskWyjsciowe += 3; } wskWejsciowe += nOffset; wskWyjsciowe += nOffset; } break; } obrazek.UnlockBits(daneWejsciowe); nowyObrazek.UnlockBits(daneWyjsciowe); return nowyObrazek; }
public IActionResult PerformAction([FromBody] trans trans) { // Do some work here return(View()); }