The issue can be reproduced by adding a RadBarCode to the form and setting its value this way:
this.radBarcode1.Value = "https://docs.telerik.com/devtools/winforms/introduction";
public
class
MyRadBarcode : RadBarcode
{
public
override
string
ThemeClassName
{
get
{
return
typeof
(RadBarcode).FullName;
}
}
protected
override
RadBarcodeElement CreateBarcodeElement()
{
return
new
MyRadBarcodeElement();
}
}
public
class
MyRadBarcodeElement : RadBarcodeElement
{
protected
override
Type ThemeEffectiveType
{
get
{
return
typeof
(RadBarcodeElement);
}
}
protected
override
void
PaintElements(IGraphics graphics, ISymbology symbology, IElementFactory elementFactory)
{
if
(symbology
as
PDF417 !=
null
)
{
graphics.TranslateTransform((
this
.Bounds.Width - elementFactory.ElementsBounds.Width) / 2f, (
this
.Bounds.Height - elementFactory.ElementsBounds.Height) / 2f);
}
else
if
(symbology
is
QRCode)
{
QRCode qRCode = (QRCode)symbology;
int
elementSize = Math.Min(
this
.Bounds.Width / qRCode.BinaryMatrix.GetLength(1),
this
.Bounds.Height / qRCode.BinaryMatrix.GetLength(0));
int
quietZone = TelerikDpiHelper.ScaleInt(QRCode.QuietZone,
this
.DpiScaleFactor) * elementSize;
graphics.TranslateTransform(Math.Abs(
this
.Bounds.Width - elementFactory.ElementsBounds.Width - quietZone) / 2f, Math.Abs(
this
.Bounds.Height - elementFactory.ElementsBounds.Height - quietZone) / 2f);
}
(graphics.UnderlayGraphics
as
Graphics).Clear(
this
.BackColor);
foreach
(BarcodeElementBase element
in
elementFactory.Elements)
{
element.PaintElement(graphics.UnderlayGraphics
as
Graphics);
}
}
}