I created a video showing how to use an open-source c# library to create a QR Code and then upload/embed a logo of your choosing into the QR Code:
http://markhagan.me/Samples/Create_QR_Code_With_Logo_ASPNet
The video is only 10 minutes long and the result is a working QR Code generator. In case you don't care to spend the ten minutes, here is the source code:
The front page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="CodeCreator._default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="URL" runat="server"></asp:TextBox>
<br /><br />
<asp:FileUpload ID="LogoUpload" runat="server" />
<br /><br />
<asp:Button ID="CreateCode" runat="server" Text="Create QR Code" OnClick="CreateCode_OnClick" />
<br /><br />
<asp:Image runat="server" ID="QRImage" />
</div>
</form>
</body>
</html>
And the code-behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MessagingToolkit.QRCode.Codec;
using MessagingToolkit.QRCode.Codec.Data;
using System.Drawing;
using System.Drawing.Imaging;
namespace CodeCreator
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CreateCode_OnClick(object sender, EventArgs e)
{
string path = "c:\\code\\projects\\CodeCreator\\CodeCreator\\";
QRCodeEncoder encoder = new QRCodeEncoder();
encoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.H; // 30%
encoder.QRCodeScale = 10;
Bitmap img = encoder.Encode(URL.Text);
LogoUpload.SaveAs(path + LogoUpload.FileName);
System.Drawing.Image logo = System.Drawing.Image.FromFile(path + LogoUpload.FileName);
int left = (img.Width / 2) - (logo.Width / 2);
int top = (img.Height / 2) - (logo.Height / 2);
Graphics g = Graphics.FromImage(img);
g.DrawImage(logo, new Point(left, top));
img.Save(path + "img.jpg", ImageFormat.Jpeg);
QRImage.ImageUrl = "img.jpg";
}
}
}