1
Answer

Temporary bitmap

Photo of Duane

Duane

12y
1.1k
1
I need to make a temporary bitmap of a selected area of my main form. The selected area will be hard-coded as it will not change, but I am uncertain how to create the bitmap without using Bitmap.Save(). This is required to check for pattern alignment between the image on the form and various saved images in a special directory (also to be hard-coded). If I have not been specific enough please let me know. I cannot provide code in this area as I am not sure where to start.

Answers (1)

0
Photo of Sandeep Singh Shekhawat
NA 22.4k 12m 12y
1. imports namesapce in class

using System.Data.SqlClient;

2. create a function in that class which retrun sqlConnection
public static SqlConnection Connection()
         {
            string connectionString = "Data Source=sandeepss-PC;database=Development;user=sa;password=knowdev";
            SqlConnection con = new SqlConnection();
            con.ConnectionString = connectionString;
            return con;
        }

3 create a function which return all login names in a data Table
 public static DataTable getUserLogin()
         {
             DataTable dt = new DataTable();
             SqlConnection con = Connection();
             SqlCommand cmd = new SqlCommand();
             cmd.CommandText = "select userLogin from tbl_login";
             cmd.Connection = con;
             con.Open();
             SqlDataReader reader = cmd.ExecuteReader();
             dt.Load(reader);
             return dt;
         }