private void btnChooseAsset_Click(object sender, EventArgs e) { if (cboAssetType.Text != string.Empty) { string filter = string.Empty; switch (cboAssetType.SelectedIndex) { case 0: case 1: filter = "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg"; break; case 2: filter = "GIF File (*.gif)|*.gif"; break; case 3: case 4: filter = "FBX File (*.fbx)|*.fbx|OBJ File (*.obj)|*.obj|Maya File (*.mb)|*.mb|Maya File (*.ma)|*.ma|3ds Max File (*.max)|*.max|Cinema 4D File (*.c4d)|*.c4d"; break; case 5: filter = "WAVE file (*.wav)|*.wav|MP3 File (*.mp3)|*.mp3"; break; } _assetFilePath = HelperTools.LoadFromFile("Upload Asset", filter); _assetUploaded = true; } else { MessageBox.Show("cboAssetType = null"); } }
private void button1_Click(object sender, EventArgs e) { //var filePath = string.Empty; //using (OpenFileDialog openFileDialog = new OpenFileDialog()) //{ // openFileDialog.Title = "NAME ME BIATCH"; // openFileDialog.InitialDirectory = "c:\\"; // openFileDialog.Filter = "PNG files (*.png)|*.png|JPEG files (*.jpg)|*.jpg|All files (*.*)|*.*"; // openFileDialog.FilterIndex = 2; // openFileDialog.RestoreDirectory = true; // if (openFileDialog.ShowDialog() == DialogResult.OK) // { // //ADD YOUR CODE HERE // //Get the path of specified file // filePath = openFileDialog.FileName; //Set image here string filepath = HelperTools.LoadFromFile("Hello", "JPEG Files (*.jpg)|*.jpg|", "c:\\"); pictureBox1.Image = Image.FromFile(filepath); // pictureBox1.Size = pictureBox1.Image.; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; //File path label1.Text = filepath; // } // else // { // MessageBox.Show("Aaron you numnut...you need to find a file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} }
private void btnChooseAsset_Click(object sender, EventArgs e) { if (cboProjectType.Text != string.Empty) { HelperTools.LoadFromFile("Upload Project", "ZIP File (*.zip)|*.zip"); } }
private void btnUploadThumbnail_Click(object sender, EventArgs e) { string _uploadedPic = HelperTools.LoadFromFile("Choose Image", "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg"); _uploadedPic = HelperTools.AddFileToStorage(_uploadedPic, (int)_curUserProject.GetAuthor().GetUserID(), _curUserProjectID); _thumbNailPic = _uploadedPic; picThumbnail.ImageLocation = _thumbNailPic; }
private void btnChangeProfilePic_Click(object sender, EventArgs e) { string file = HelperTools.LoadFromFile(); string databasePath = HelperTools.AddFileToStorage(file, (int)_currentUser.GetUserID()); DataBaseAccess dataBaseAccess = new DataBaseAccess(); dataBaseAccess.StartConnection(); dataBaseAccess.ChangeUserProfile((int)_currentUser.GetUserID(), databasePath); dataBaseAccess.CloseConnection(); }
private void btnUpload_Click(object sender, EventArgs e) { string _uploadedPic = HelperTools.LoadFromFile("Choose Image", "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg"); _uploadedPic = HelperTools.AddFileToStorage(_uploadedPic, _userID, _assetID); if (_uploadedPic != string.Empty) { if (_pictures[_pictureInView] == "null") { _pictures[_pictureInView] = _uploadedPic; picImage.ImageLocation = _pictures[_pictureInView]; } else { _pictures.Add(_uploadedPic); _pictureInView++; picImage.ImageLocation = _pictures[_pictureInView]; } } else { picImage.ImageLocation = _pictures[_pictureInView]; } }