// Send to Mobile Function private void bunifuFlatButton2_Click(object sender, EventArgs e) { var qrCreator = new QrHelper(150, 150, 3, UserInfo.EventId.ToString() + "/" + UId); Bitmap qr = qrCreator.GetQRCode(); if (!Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "temp"))) { Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "temp")); } qr.Save(Path.Combine(Directory.GetCurrentDirectory(), "temp/generated.jpg")); new BluetoothDeviceChooser().Show(); //} //Redirect(); }
public void Serialize(string attendeeId) { UId = attendeeId; var qrCreator = new QrHelper(150, 150, 3, UserInfo.EventId.ToString() + "/" + attendeeId); Bitmap qr = qrCreator.GetQRCode(); var Ticket = new Bitmap(QR.Width, QR.Height); var graphics = Graphics.FromImage(Ticket); // Ticket graphics.DrawRectangle(new Pen(Brushes.Black), new Rectangle(new Point(0, 0), new Size(QR.Width - 1, QR.Height - 1))); // Outline graphics.DrawImage(Resources.bulsu_colored, new Rectangle(new Point(8, 8), new Size(70, 70))); graphics.DrawString("Bulacan State University", new Font("Times New Roman", 11F), Brushes.Black, new Point(90, 20)); // Authority Name graphics.DrawString("Malolos Bulacan, Philippines", new Font("Times New Roman", 11F), Brushes.Black, new Point(90, 35)); // Authority Address graphics.DrawImage(qr, new PointF(75, 65)); // QR graphics.DrawString(UserInfo.EventName, new Font("Times New Roman", 11F, FontStyle.Regular), new SolidBrush(Color.DarkSlateGray), new Point(75, 220)); // Event Name graphics.DrawString("Ticket No: " + attendeeId, new Font("Times New Roman", 11F, FontStyle.Regular), Brushes.Black, new Point(20, 240)); // Ticket No graphics.DrawString(attendee, new Font("Times New Roman", 11F, FontStyle.Regular), Brushes.Black, new Point(20, 255)); // Owner Name graphics.DrawString(UserInfo.EventLocation, new Font("Times New Roman", 11F, FontStyle.Regular), Brushes.Black, new Point(20, 270)); // Event Location QR.Image = Ticket; }