Rendering 2D barcode bitmaps -
i have application processes svg messages sent customer's host. embedded in message several images, 1 of 2d (pdf-417) barcode. have main canvas rendering various elements contained in svg message, includes text , other imagery, or icons. works great except when comes rendering 2d barcode. 2d barcode getting rendered canvas , looks clean , sharp no barcode reader can read barcode. if save original barcode downloaded host can scan reader. not can scale it, rotate it, it, can scan final barcode rendered main canvas.
i'm drawing barcode bitmap main canvas graphics.drawimage.
_innergraphics.smoothingmode = smoothingmode.none; _innergraphics.drawimage(image, destrect, srcrect, graphicsunit); close examination of original bitmap , image rendered main canvas show differences, not being 2d barcode expert , not have expensive barcode analyzer tool makes difficult impossible determine wrong.
the diffculty of 2d (pdf417) barcodes image must exact or bcr (barcode reader) not able scan image.
*********** added content ****** yes, saw that. , part agree you. however, doing lot of reading, experimenting , discussing problem engineer here i/we came following 3 options applied graphics object property "interpolationmode.
// - innergraphics.interpolationmode = interpolationmode.highqualitybicubic;
// _innergraphics.interpolationmode = interpolationmode.highqualitybilinear;
_innergraphics.interpolationmode = interpolationmode.high;
i left set @ interpolationmode.high time being testing purposes. image rendered scans now. confusing item rendered image works still has unequal lines pointed out along few other items have guessed should have made fail.
additional information: few more items should know. main canvas svg engine rendering via c# graphics object has pixel format of format32bppargb. bitmap containing barcode that's being downloaded customer's web site format24bpprgb. barcode image being rendered main canvas via graphics.drawimage(). think graphics object doing best morph 24bpprgb format 32bppargb format causing distortion. if print original 24 bit bitmap image creates beautiful bitmap. looks sharp 1 bit monochrome image. i’m kind of @ loss exact/correct barcode bitmap rendered onto main drawing canvas. i’ve got credit success far more or less guess work.
if possible attempt attach 2 bitmaps viewing.
bad image: bad final image image: good image
can please help?
9/1/2017 - update morning extrapolated core pieces of code out of svg library needed rendering 2d barcode. successful in recreating problem. next started adjusting of math , values understand of how different function points effecting rendering of barcode main canvas. can render 2d barcode in size want ( within reason ) , render beautiful perfect 2d barcode. of adjustments i'm not quite sure understand yet, once fuzzy , totally confusing starting come focus. starting understand what's going on. in short it's source , destination rectangle calculations when rendering main canvas. after testing , experimenting i'm pretty sure problem has boiled down scaling. original bitmap sent outputorig.bmp size 808 x 175. how receive customer's host. have no control on it's size. bitmap must rendered rectangle on main canvas 245 x 94. that's 30% of it's original size. can shrink degree success using variety of scaling routines have found on web. i've been able shrink down 60% of it's original size , still able scan barcode. go beyond , becomes unscannable. ideas anyone?
thanks al harper
Comments
Post a Comment