Solved

Copy thumbnailed images from one location to another

Posted on 2007-03-28
3
194 Views
Last Modified: 2013-12-17
Hi all, I need to understand how to display thumbnails in a windows forms panel (c# dot.net), copy them to another panel and then upon pressing the apply button, copy the selection to a specified location (ie.  My pictures)

I have provided an image for what I am trying to acheve.  Shouldn't be too difficult i hope but all help would be greatly appreciated.

http://www.cdnpharmaceuticals.com.au/experts/Image.JPG
0
Comment
Question by:cdempster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 18822931
is this
what u wnat u can drag image from one panel to another then saving would be relatively easy

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace WINAPP
{
      /// <summary>
      /// Summary description for Form5.
      /// </summary>
      public class Form5 : System.Windows.Forms.Form
      {
            private System.Windows.Forms.Panel panel1;
            private System.Windows.Forms.Panel panel2;
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.Container components = null;

            public Form5()
            {
                  //
                  // Required for Windows Form Designer support
                  //
                  InitializeComponent();

                  PictureBox FBox1 = new PictureBox
                        ();
                  FBox1.Image = new Bitmap(@"D:\DOC\2.jpg");
                  FBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                  FBox1.Dock = DockStyle.Top;
                  panel1.Controls.Add(FBox1);
                  panel2.AllowDrop = true;
                  this.AllowDrop = true;
                  FBox1.MouseDown += new MouseEventHandler(FBox1_MouseDown);
                  FBox1 = new PictureBox
                        ();
                  FBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                  FBox1.Image = new Bitmap(@"D:\DOC\3.jpg");
                  FBox1.Dock = DockStyle.Top;
                  panel2.DragDrop += new DragEventHandler(groupBox2_DragDrop);
                  panel2.DragEnter += new DragEventHandler(groupBox2_DragEnter);
                  this.DragEnter += new DragEventHandler(groupBox2_DragEnter);
                  FBox1.MouseDown += new MouseEventHandler(FBox1_MouseDown);
                  panel1.Controls.Add(FBox1);
            }

            void FBox1_MouseDown(object sender, MouseEventArgs e)
            {
                  DoDragDrop(((PictureBox)sender).Image, DragDropEffects.Copy);
            }

            void groupBox2_DragEnter(object sender, DragEventArgs e)
            {
                  e.Effect = DragDropEffects.Copy;
            }

            void groupBox2_DragDrop(object sender, DragEventArgs e)
            {
                  if (e.Data.GetData(typeof(Bitmap)) != null)
                  {
                        Bitmap FMap =
                              (Bitmap)e.Data.GetData(typeof(Bitmap));
                        PictureBox FBox1 = new PictureBox
                              ();
                        FBox1.Image = FMap;
                        FBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                        FBox1.Dock = DockStyle.Top;
                        panel2.Controls.Add(FBox1);  
                  }
            }

            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            protected override void Dispose( bool disposing )
            {
                  if( disposing )
                  {
                        if(components != null)
                        {
                              components.Dispose();
                        }
                  }
                  base.Dispose( disposing );
            }

            #region Windows Form Designer generated code
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                  this.panel1 = new System.Windows.Forms.Panel();
                  this.panel2 = new System.Windows.Forms.Panel();
                  this.SuspendLayout();
                  //
                  // panel1
                  //
                  this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                  this.panel1.Location = new System.Drawing.Point(8, 8);
                  this.panel1.Name = "panel1";
                  this.panel1.Size = new System.Drawing.Size(288, 264);
                  this.panel1.TabIndex = 2;
                  //
                  // panel2
                  //
                  this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                  this.panel2.Location = new System.Drawing.Point(320, 8);
                  this.panel2.Name = "panel2";
                  this.panel2.Size = new System.Drawing.Size(336, 256);
                  this.panel2.TabIndex = 3;
                  //
                  // Form5
                  //
                  this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
                  this.ClientSize = new System.Drawing.Size(672, 273);
                  this.Controls.Add(this.panel2);
                  this.Controls.Add(this.panel1);
                  this.Name = "Form5";
                  this.Text = "Form5";
                  this.ResumeLayout(false);

            }
            #endregion
      }
}

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question