
It is possible to set the height and width of the QR Code in pixels?. Already set de DotSize in 0, but the result image always has 53x53px.
5 Answers, 1 is accepted
If you want to have the barcode size to its container you need to set DotSize to 0: https://docs.telerik.com/devtools/aspnet-ajax/controls/barcode/qrcode.
<
telerik:RadBarcode
runat
=
"server"
ID
=
"RadBarcode1"
Type
=
"QRCode"
Height
=
"140px"
Width
=
"140px"
<
QRCodeSettings
Version
=
"5"
DotSize
=
"0"
Mode
=
"Byte"
/>
</
telerik:RadBarcode
>
<
telerik:RadBarcode
runat
=
"server"
ID
=
"RadBarcode2"
Type
=
"QRCode"
Height
=
"340px"
Width
=
"340px"
<
QRCodeSettings
Version
=
"5"
DotSize
=
"0"
Mode
=
"Byte"
/>
</
telerik:RadBarcode
>
Regards,
Marin Bratanov
Progress Telerik

Thanks Marin, here is my code:
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
<telerik:RadTextBox RenderMode="Lightweight" ID="RadTextBoxURL" LabelWidth="40px" Width="400px" runat="server"
Label="URL: " Text="www.google.com" />
<telerik:RadButton RenderMode="Lightweight" ID="Button1" runat="server" Text="Generate" OnClick="Button1_Click" />
<telerik:RadBarcode runat="server" ID="barcode" Type="QRCode" OutputType="EmbeddedPNG"
>
<QRCodeSettings Version="5" DotSize="0" Mode="Byte" />
</telerik:RadBarcode>
<telerik:RadTextBox ID="txtTamano" runat="server" Label="Tamaño"></telerik:RadTextBox>
<telerik:RadTextBox ID="txtDotSize" runat="server" Label="DotSize"></telerik:RadTextBox>
protected void Button1_Click(object sender, EventArgs e)
{
//barcode.BorderWidth = 0;
barcode.QRCodeSettings.DotSize = Convert.ToInt16(txtDotSize.Text);
barcode.Height = Convert.ToInt16(txtTamano.Text);
barcode.Width = Convert.ToInt16(txtTamano.Text);
barcode.Text = RadTextBoxURL.Text;
Bitmap bitmap1 = new Bitmap(barcode.GetImage());
bitmap1.Save("C:\\inetpub\\wwwroot\\cache\\ale.png", System.Drawing.Imaging.ImageFormat.Png);
//string sArc = "C:\\inetpub\\wwwroot\\cache\\ale.png";
//barcode.GetImage().Save(sArc);
}
The image always has 45x45 px as you can see in th attached file.
Is the version related with de heigth and width? with AutoIncreaseVersion="true" the image always has 53x53px
Alejandro


I added explanations on how this works in the documentation, and they will be live with our next upload. You can preview them here: https://github.com/telerik/ajax-docs/blob/master/controls/barcode/qrcode.md#how-to-control-the-size-of-the-qr-code. I hope this explains how the control works.
Regards,
Marin Bratanov
Progress Telerik