GdiRenderSettingsSynchronized Property

Setting Synchronized to true will use a global lock for all GDI calls that get invoked by Page.Draw.

Namespace:  TallComponents.PDF.Rasterizer.Configuration
Assembly:  TallComponents.PDF.Rasterizer (in TallComponents.PDF.Rasterizer.dll) Version:
public static bool Synchronized { get; set; }

Property Value

Type: Boolean

Graphics instances that are created for MetaFile "images" are not completely independent. Concurrent drawing to these instances may cause GDI exceptions. This GDI bug is most likely to occur with EmfType.EmfPlusDual, although we have had reports that other types have the same issue. If you have multiple threads that draw to MetaFile instances, Synchronized should be set to true, which serialize all GDI calls that are done through Page.Draw(). We have no indication that it is problematic to render to multiple bitmaps simultaneously.

Setting this value will have no effect on DrawJob instances, as these do not appear to interfere with MetaFile jobs. So DrawJobs will still issue GDI+ calls concurrently if this propery has been set.

By default, this value is false, because serializing all GDI+ calls may be suboptimal in multi-core system. Normally the GDI+ implementation will/should ensure that the necessary locks are applied when needed.

Warning: This setting should not be changed while any rendering is going on. This may cause unexpected behavior or exceptions.

See Also