Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

GDI+ Antialiasing a region or fully subtract one path from another

Posted on 2008-06-09
1
1,034 Views
Last Modified: 2013-12-17
Is there any nice, clean way to antialias a region? I do not mind doing it "unsafe".

Here is what I have: a small transparent bitmap with a single (filled with one or 2 colors brush) shape. Shape is resulted from region>path intersection.

I tried to use 2 graphics paths alone (automatically solves antialiasing problem). But because resulted shape must be a Photoshop "subtract path" equivalent, I was unable to find any solution to fully subtract one path from another.

So I'm thinking going with a region, then getting pixels from memory, finding shape edges.. but that is as far as I went. If anyone can point me to the right direction as to what to do next, possibly has algorithm for the alpha at edges, or has more elegant solution to the problem.

Thanks.

shapes.png
0
Comment
Question by:4u2ges
1 Comment
 
LVL 1

Accepted Solution

by:
4u2ges earned 0 total points
ID: 21798880
Settled for a compromise with path subtraction (Photoshop subtract path simulation). On fully opaque background, fill path2 with texture brush from current bitmap created before path1 is filled. If any transformation were applied to bitmap graphics before texture brush is created, then brush has to have reversed transformation applied.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question