Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy thumbnailed images from one location to another

Posted on 2007-03-28
3
Medium Priority
?
195 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 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