Click here to Skip to main content
15,906,569 members
Home / Discussions / C#
   

C#

 
QuestionC# C++ Java performance comparison Pin
devvvy17-Jan-10 3:47
devvvy17-Jan-10 3:47 
AnswerRe: C# C++ Java performance comparison Pin
EliottA17-Jan-10 4:08
EliottA17-Jan-10 4:08 
AnswerRe: C# C++ Java performance comparison Pin
Luc Pattyn17-Jan-10 4:33
sitebuilderLuc Pattyn17-Jan-10 4:33 
AnswerRe: C# C++ Java performance comparison Pin
N a v a n e e t h17-Jan-10 4:34
N a v a n e e t h17-Jan-10 4:34 
AnswerRe: C# C++ Java performance comparison Pin
harold aptroot17-Jan-10 4:53
harold aptroot17-Jan-10 4:53 
GeneralRe: C# C++ Java performance comparison Pin
devvvy19-Jan-10 19:14
devvvy19-Jan-10 19:14 
GeneralRe: C# C++ Java performance comparison Pin
harold aptroot20-Jan-10 1:17
harold aptroot20-Jan-10 1:17 
Questionerrors pls help..... Pin
djsproject17-Jan-10 2:02
djsproject17-Jan-10 2:02 
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();
                    infoForm.cropOK += new CropInfoEventHandler(infoForm_cropOK);
                    infoForm.Show();
                }
            }
       }
        void infoForm_cropOK(object sender, CropInfoEventArgs e)
        {
            Image img = this.cropImage(Image img, new Rectangle(e.X, e.Y, e.Width, e.Height));
            //this.setPicBoxImage();
        }

        private Image cropImage(Image img, Rectangle cropArea)
        {
            Bitmap bmpImage = new Bitmap(img);
            Bitmap bmpCrop = bmpImage.Clone(cropArea,
                                            bmpImage.PixelFormat);
            return (Image)(bmpCrop);
        }

        }


}    }

thanking you in advance
QuestionMessage Removed Pin
17-Jan-10 1:03
sachees12317-Jan-10 1:03 
AnswerRe: very special problem Pin
Dan Mos17-Jan-10 1:51
Dan Mos17-Jan-10 1:51 
GeneralRe: very special problem Pin
sachees12317-Jan-10 2:01
sachees12317-Jan-10 2:01 
GeneralRe: very special problem Pin
Dan Mos17-Jan-10 2:51
Dan Mos17-Jan-10 2:51 
GeneralRe: very special problem Pin
sachees12317-Jan-10 2:11
sachees12317-Jan-10 2:11 
GeneralRe: very special problem Pin
Md. Marufuzzaman17-Jan-10 4:00
professionalMd. Marufuzzaman17-Jan-10 4:00 
Questionwindows not in focus Pin
michaelgr116-Jan-10 22:49
michaelgr116-Jan-10 22:49 
AnswerRe: windows not in focus Pin
dan!sh 16-Jan-10 23:20
professional dan!sh 16-Jan-10 23:20 
AnswerRe: windows not in focus Pin
OriginalGriff16-Jan-10 23:25
mveOriginalGriff16-Jan-10 23:25 
GeneralRe: windows not in focus Pin
michaelgr116-Jan-10 23:42
michaelgr116-Jan-10 23:42 
GeneralRe: windows not in focus Pin
OriginalGriff16-Jan-10 23:48
mveOriginalGriff16-Jan-10 23:48 
GeneralRe: windows not in focus Pin
michaelgr116-Jan-10 23:57
michaelgr116-Jan-10 23:57 
GeneralRe: windows not in focus Pin
OriginalGriff17-Jan-10 0:13
mveOriginalGriff17-Jan-10 0:13 
GeneralRe: windows not in focus Pin
Heinzzy17-Jan-10 0:48
Heinzzy17-Jan-10 0:48 
GeneralRe: windows not in focus Pin
MickCurley17-Jan-10 3:30
MickCurley17-Jan-10 3:30 
GeneralRe: windows not in focus Pin
Luc Pattyn17-Jan-10 4:36
sitebuilderLuc Pattyn17-Jan-10 4:36 
GeneralRe: windows not in focus Pin
Heinzzy17-Jan-10 4:57
Heinzzy17-Jan-10 4:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.