Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Open Vision for NET
»
NOV Diagram for .NET
»
How to programmatically save the drawing as PNG with transparent...
How to programmatically save the drawing as PNG with transparent background
Post Reply
How to programmatically save the drawing as PNG with transparent...
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Nevron Support
Nevron Support
posted 4 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.2K
Hi,
By default the page has white background. Set the background the page to a transparent color fill and the exported PNG image will have transparent background, too:
drawingView.ActivePage.BackgroundFill = new NColorFill(NColor.Transparent);
Best Regards,
Nevron Support Team
Reply
Like
0
Ashley Davy
Ashley Davy
posted 4 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 36,
Visits: 119
I have a require to save the drawing as a PNG file with a transparent background. I have been looking at the code but I am not sure how to tie it all together. Below is what I have so far but I am not sure how to apply the Encoder Settings and make the background transparent.
Thanks,
Ashley
Dim ImgPngEncoder As NPngEncoderSettings = New NPngEncoderSettings()
ImgPngEncoder.ColorType = ENPngColorType.TrueColorWithAlpha
ImgPngEncoder.CompressionLevel = Nevron.Nov.Compression.ENCompressionLevel.BestCompression
Dim ImgRasterExporter As NDrawingRasterImageExporter = New NDrawingRasterImageExporter(Draw2.View.Content.OwnerDocument)
ImgRasterExporter.SaveToFile("C:\AD_ATF\AD1.png")
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search