Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / March 2008

Tip: Looking for answers? Try searching our database.

Custom BitmapEffect and BitmapEffectInput

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ike Starnes - 25 Feb 2008 21:58 GMT
I've created my own custom BitmapEffect based on the RGBFilter example from
MSDN.  However, I've noticed that both my effect and the RGBFilter effect
fail to pay attention to the BitmapEffectInput, and always process the entire
image.
For example, add this:
       <Image.BitmapEffectInput>
         <BitmapEffectInput AreaToApplyEffect=".25,.25,.50,.50"
AreaToApplyEffectUnits="RelativeToBoundingBox"/>
       </Image.BitmapEffectInput>
and it will be ignored.

Does anyone know how I can get the BitmapEffectInput from inside my
implementation of IMILBitmapEffectPrimitive?
Ike Starnes - 01 Mar 2008 01:31 GMT
Here is the solution:
In the GetOutput implementation I used the IMILBitmapEffectRenderContext.

To take the area of interest into account, I got the
IMILBitampEffectRenderContextImpl from IMILBitmapEffectRenderContext.

Code Snippet    
//**********************************************************************
   // Get our render context's implementation interface
   //**********************************************************************
   CComPtr<IMILBitmapEffectRenderContextImpl> spRenderContextImpl;
   if (SUCCEEDED(hr))
   {
       hr = pRenderContext->QueryInterface(__uuidof
IMILBitmapEffectRenderContextImpl),
            reinterpret_cast<void**>(&spRenderContextImpl));
   }





Then, I used the GetOutputBounds method of the
IMILBitmapEffectRenderContextImpl.
Using that, I can apply the effect only to the output bounds specified by
the BitmapEffectInput.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.