File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,14 @@ public void SetResolution(float xDpi, float yDpi)
275
275
{
276
276
if ( xDpi <= 0 || yDpi <= 0 )
277
277
throw new ArgumentOutOfRangeException ( "DPI values must be greater than zero." ) ;
278
- throw new NotSupportedException ( "not supported by skia" ) ; // SOURCE: https://issues.skia.org/issues/40043604
278
+ if ( float . IsNaN ( xDpi ) || float . IsInfinity ( xDpi ) )
279
+ throw new ArgumentException ( $ "DPI values must be numbers but { xDpi } was given.", nameof ( xDpi ) ) ;
280
+ if ( float . IsNaN ( yDpi ) || float . IsInfinity ( yDpi ) )
281
+ throw new ArgumentException ( $ "DPI values must be numbers but { yDpi } was given.", nameof ( yDpi ) ) ;
282
+ HorizontalResolution = xDpi ;
283
+ VerticalResolution = yDpi ;
284
+ // NOTE: HorizontalResolution and VerticalResolution properties assignment has no effect
285
+ // on Save because Skia does not support it (source: https://issues.skia.org/issues/40043604)
279
286
}
280
287
281
288
/// <summary>
You can’t perform that action at this time.
0 commit comments