Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. errors pls help.....

errors pls help.....

Scheduled Pinned Locked Moved C#
csharpc++linqgraphicshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    djsproject
    wrote on last edited by
    #1

    I wanted to crop multiple images at the same time.I tried to integrate the code for cropping single image with my code and got messed up.Can somebody help with this code.....

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Drawing.Drawing2D;
    using System.Drawing.Imaging;

    namespace batch_image_editor
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

        private void splitContainer1\_SplitterMoved(object sender, SplitterEventArgs e)
        {
    
        }
    
        private void addphotos\_Click(object sender, EventArgs e)
        {
            opend1.Filter = "Image Files(\*.BMP;\*.JPG;\*.GIF)|\*.BMP;\*.JPG;\*.GIF|All files (\*.\*)|\*.\*";
            opend1.Multiselect = true;
            imageList.Images.Clear();
            listView1.Items.Clear();
            if (opend1.ShowDialog() == DialogResult.OK)
            {
                listView1.View = View.LargeIcon;
                imageList.ImageSize = new Size(50, 50);
                for (int c = 0; c < opend1.FileNames.Length; c++)
                {
                    Image i = Image.FromFile(opend1.FileNames\[c\].ToString());
                    Image img = i.GetThumbnailImage(256, 256, null, new IntPtr());
                    imageList.Images.Add(img);
                }
                listView1.LargeImageList = imageList;
    
                for (int j = 0; j < imageList.Images.Count; j++)
                {
                    ListViewItem lstItem = new ListViewItem();
                    lstItem.ImageIndex = j;
                    listView1.Items.Add(lstItem);
                }
                this.cropToolStripMenuItem.Enabled = true;
                this.resizeToolStripMenuItem.Enabled = true;
                this.compressToolStripMenuItem.Enabled = true;
                this.greyScaleToolStripMenuItem.Enabled = true;
                this.save.Enabled = true;
            }
    
    
        }
    

    private void cropToolStripMenuItem_Click(object sender, EventArgs e)
    {
    listView1.LargeImageList = null;

            ImageList imgListNew = new ImageList();
            for (int i = 0; i < listView1.Items.Count; i++)
            {
                if (listView1.Items\[i\].Checked)
                {
                    frmCropInfo infoForm = new frmCropInfo();
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups