Solved

change image size without changing the resolution

Posted on 2013-06-03
1
940 Views
Last Modified: 2013-06-04
Hi Experts,
i created a simple code in C# to generate QRCode image size 197x197 for employees, my question is how to change the size without losing the quality.

protected void Page_Load(object sender, EventArgs e)
        {
            //--read employees information            
            string text, strSQL;
            strSQL = "select CPRNo, EngName,'1757' + OfficeTel as Tel,FaxNo,EmpEmail from GetUserDetailsE where PERUserName='mffinjm' ";
            EmpInfo empinfo = new EmpInfo();
            SqlDataReader sqlReader = null;
            using (SqlConnection con = GetConnectedPr())
            {
                SqlCommand myCommand = new SqlCommand(strSQL, con);
                sqlReader = myCommand.ExecuteReader();
                while (sqlReader.Read())
                {
                    empinfo.CPR = sqlReader["CPRNo"].ToString();
                    empinfo.EngName = sqlReader["EngName"].ToString();
                    empinfo.Tell = sqlReader["Tel"].ToString();
                    empinfo.email = sqlReader["EmpEmail"].ToString();
                    empinfo.Fax = sqlReader["FaxNo"].ToString();
                 }
             }                            
            //--Create QRCode
            QRCodeEncoder encoder = new QRCodeEncoder();
            text = "N:" +empinfo.EngName + ";TEL:"+ empinfo.Tell +";URL:http://www.mof.gov.bh;EMAIL:"+ empinfo.email +
                ";FAX:" + empinfo.Fax + ";NOTE:Ministry of Finance";
            Bitmap img = encoder.Encode(text);            
            img.Save(Server.MapPath("/images/"+ empinfo.CPR +".jpg"), ImageFormat.Jpeg);
            QRImage.ImageUrl = "~/images/" + empinfo.CPR + ".jpg";                  
        }

Open in new window


any suggestion

thank you
0
Comment
Question by:AZZA-KHAMEES
[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
1 Comment
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
ID: 39218232
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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