public void Display() { if (readImage == null) { readImage = new ReadImage(fileName); } readImage.Display(); }
/// <summary> /// コンストラクタ /// </summary> public ImageList() { InitializeComponent(); Icon = ReadImage.DrawingIcon("EditorMC2D.Resources.ImageChisel_16x.png"); m_dirNum = 0; m_betweenDir = ""; m_isOpenImage = false; if (!this.ComboBoxDataSet()) { cbDir.SelectedIndex = 0; } }
public IActionResult IsItAdded(string filePath) { var BarCode = new ReadImage().GetBarCodeFromToTheImage(filePath); var Exist = new ProductRepo().DoesTheProductExists(BarCode); if (BarCode == null) { return(this.Json($"No se pudo tener el Codigo de barras, imagen borrosa, intentelo de nuevo")); } if (Exist) { return(this.RedirectToAction("BestPrice", "Price", new { id = BarCode })); } else { return(this.RedirectToAction("LoadPrice", "Price", new { BarCode = BarCode })); } }
public void mergeTest() { Node nR1 = new ReadImage(); Node nR2 = new ReadImage(); Node nM = new Merge(); nR1.setPos(0, -50); nR2.setPos(0, 50); nM.setPos(180, 0); (nR1 as ReadImage).setPath("C:\\temp\\uv.jpg"); (nR2 as ReadImage).setPath("C:\\temp\\lena.tif"); Node.connect(nR1, "outColor", nM, "inColorA"); Node.connect(nR2, "outColor", nM, "inColorB"); viewNodes.addNode(nR1); viewNodes.addNode(nR2); viewNodes.addNode(nM); }
private void btnGrayscale2_Click(object sender, EventArgs e) { try { if (this.pictureBoxKMeans.Image != null) { ReadImage read = new ReadImage(bitmap); byte[,] red = read.Red; byte[,] green = read.Green; byte[,] blue = read.Blue; int mati = red.GetLength(0); int matj = red.GetLength(1); grayscale = new byte[mati, matj]; for (int i = 0; i < mati; i++) { for (int j = 0; j < matj; j++) { grayscale[i, j] = Convert.ToByte((red[i, j] + green[i, j] + blue[i, j]) / 3); } } create = new CreateImage(grayscale); this.pictureBoxKMeans.Image = (Image)create.Btmp; } else { MessageBox.Show("Silahkan input gambar"); } } catch (Exception ex) { MessageBox.Show("Error : " + ex.ToString()); } }
public IActionResult LoadPrice([FromForm] ProductViewModel product) { if (ModelState.IsValid) { bool Exist = new ReadImage().BarCodeExist(product.BarCode); if (Exist) { new Price().newPrice(Traducir(product)); } else { new Prod().AddProduct(Traducir(product)); new Price().newPrice(Traducir(product)); } return(RedirectToAction("BestPrice", "Price", new { id = product.BarCode })); } else { return(this.View(product)); } }
/// <summary> /// イメージを読み込む、同じイメージは読み込まない /// </summary> /// <param name="fileName">ファイル名</param> /// <returns>読み込みエラーのときはfalseを返す。 成功時には、trueを返す</returns> bool ImageFileLoad(string fileName) { ListViewItem listVI; string fullPas; if (fileName == "") { return(false); } if (m_readFileName == fileName) { return(true); } m_readFileName = fileName; fullPas = CommonMC2D.Instance.DirPathMC2D; fullPas += @"\Media\images\"; fullPas += m_betweenDir; fullPas += fileName; // フルパス取得 m_readFullPathFileName = fullPas; // イメージのセレクト ImageFileInfo imgInfo; // try{ pictureBoxImg.Image = ReadImage.DrawingBitmap(fullPas); }catch { return(false); } listViewImgInfo.Items.Clear(); try { imgInfo = new ImageFileInfo(fullPas); } catch { return(false); } //========================================== //---- ListView //Win32.SHGetFileInfo(strFullPas, Win32.FILE_ATTRIBUTE_ARCHIVE, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_EXETYPE | Win32.SHGFI_TYPENAME); Shell32.CItem item1 = new Shell32.CItem(); Shell32.GetFileInfo(fullPas, ref item1); listVI = new ListViewItem(new string[] { "画像の種類", imgInfo.Type.ToString() }); listViewImgInfo.Items.Add(listVI); // Property 幅高さ fullPas = string.Format("{0:D} × {1:D}", imgInfo.Width, imgInfo.Height); listVI = new ListViewItem(new string[] { "幅×高", fullPas }); listViewImgInfo.Items.Add(listVI); if (imgInfo.Type == MC_FILE_TYPE.DDS) { //// Property フォーマット //fullPas = imgInfo.MetadataDDS.; //listVI = new ListViewItem(new string[] { "フォーマット", fullPas }); //listViewImgInfo.Items.Add(listVI); //// Property ビットの深さ //fullPas = string.Format("{0:D}", imgInfo.MetadataDDS.); //listVI = new ListViewItem(new string[] { "深度", fullPas }); //listViewImgInfo.Items.Add(listVI); //// Property ミップレベル //fullPas = string.Format("{0:D}", imgInfo.MetadataDDS); //listVI = new ListViewItem(new string[] { "ミップレベル", fullPas }); //listViewImgInfo.Items.Add(listVI); //// Property リソースタイプ ////strFullPas = txInfo.ResourceType.ToString(); ////listVI = new ListViewItem(new string[] { "リソースタイプ", strFullPas }); ////listViewImgInfo.Items.Add(listVI); } return(true); }