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

x
?
Solved

change image size without changing the resolution

Posted on 2013-06-03
1
Medium Priority
?
954 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 2000 total points
ID: 39218232
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

715 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