@@ -59,13 +59,13 @@ public Bitmap GetGraphic(Bitmap backgroundImage = null)
59
59
/// <param name="backgroundImageStyle">Style of the background image (if set). Fill=spanning complete graphic; DataAreaOnly=Don't paint background into quietzone</param>
60
60
/// <param name="finderPatternImage">Optional image that should be used instead of the default finder patterns</param>
61
61
/// <returns>QRCode graphic as bitmap</returns>
62
- public Bitmap GetGraphic ( int pixelsPerModule , Color darkColor , Color lightColor , Color backgroundColor , Bitmap backgroundImage = null , double pixelSizeFactor = 0.8 ,
62
+ public Bitmap GetGraphic ( int pixelsPerModule , Color darkColor , Color lightColor , Color backgroundColor , Bitmap backgroundImage = null , double pixelSizeFactor = 1 ,
63
63
bool drawQuietZones = true , QuietZoneStyle quietZoneRenderingStyle = QuietZoneStyle . Dotted ,
64
64
BackgroundImageStyle backgroundImageStyle = BackgroundImageStyle . DataAreaOnly , Bitmap finderPatternImage = null )
65
65
{
66
66
if ( pixelSizeFactor > 1 )
67
67
throw new Exception ( "The parameter pixelSize must be between 0 and 1. (0-100%)" ) ;
68
- int pixelSize = ( int ) Math . Min ( pixelsPerModule , Math . Floor ( pixelsPerModule / pixelSizeFactor ) ) ;
68
+ int pixelSize = ( int ) Math . Min ( pixelsPerModule , Math . Floor ( pixelsPerModule * pixelSizeFactor ) ) ;
69
69
70
70
var numModules = QrCodeData . ModuleMatrix . Count - ( drawQuietZones ? 0 : 8 ) ;
71
71
var offset = ( drawQuietZones ? 0 : 4 ) ;
@@ -283,7 +283,7 @@ public static class ArtQRCodeHelper
283
283
/// <param name="finderPatternImage">Optional image that should be used instead of the default finder patterns</param>
284
284
/// <returns>QRCode graphic as bitmap</returns>
285
285
public static Bitmap GetQRCode ( string plainText , int pixelsPerModule , Color darkColor , Color lightColor , Color backgroundColor , ECCLevel eccLevel , bool forceUtf8 = false ,
286
- bool utf8BOM = false , EciMode eciMode = EciMode . Default , int requestedVersion = - 1 , Bitmap backgroundImage = null , double pixelSizeFactor = 0.8 ,
286
+ bool utf8BOM = false , EciMode eciMode = EciMode . Default , int requestedVersion = - 1 , Bitmap backgroundImage = null , double pixelSizeFactor = 1.0 ,
287
287
bool drawQuietZones = true , QuietZoneStyle quietZoneRenderingStyle = QuietZoneStyle . Flat ,
288
288
BackgroundImageStyle backgroundImageStyle = BackgroundImageStyle . DataAreaOnly , Bitmap finderPatternImage = null )
289
289
{
@@ -295,4 +295,4 @@ public static Bitmap GetQRCode(string plainText, int pixelsPerModule, Color dark
295
295
}
296
296
}
297
297
298
- #endif
298
+ #endif
0 commit comments