![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi Rolf, In WPF, you can use BitmapEffect to apply visual effects. We have 5 built-in effects: Blur, DropShadow, OuterGlow, Bevel, Emboss. However, we currently don't have a built-in effect to change brightness or contrast, but you can create a custom BitmapEffect to do this: #WPF Bitmap Effects http://msdn2.microsoft.com/en-us/lib...related_topics Hope this helps. Regards, Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#4
| |||
| |||
|
|
Hi Rolf, In WPF, you can use BitmapEffect to apply visual effects. We have 5 built-in effects: Blur, DropShadow, OuterGlow, Bevel, Emboss. However, we currently don't have a built-in effect to change brightness or contrast, but you can create a custom BitmapEffect to do this: #WPF Bitmap Effects http://msdn2.microsoft.com/en-us/lib...related_topics Hope this helps. Regards, Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Hi Rolf, I tested the sample and did find the issue you mentioned. The code should be corrected to: public class RGBFilterBitmapEffect : BitmapEffect { unsafe protected override SafeHandle CreateUnmanagedEffect() { const uint CLSCTX_INPROC_SERVER = 1; Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046"); Guid guidEffectCLSID = new Guid("84CF07CC-34C4-460f-B435-3184F5F2FF2A"); SafeHandle wrapper = BitmapEffect.CreateBitmapEffectOuter(); COMSafeHandle unmanagedEffect; uint hresult = Ole32Methods.CoCreateInstance( ref guidEffectCLSID, wrapper.DangerousGetHandle(), CLSCTX_INPROC_SERVER, ref IID_IUnknown, out unmanagedEffect); if (hresult != 0) throw new Exception("Cannot instantiate effect. HRESULT = " + hresult.ToString()); InitializeBitmapEffect(wrapper, unmanagedEffect); return wrapper; } Also, you need to manually register RGBFilterEffect\RGBFilterEffectLib\Debug\RGBFilter EffectLib.dll using regsvr32.exe. ---------- For your another question about the performance, currently WPF version 1.0 BitmapEffect is only using software mode. Therefore the performance issue does exist. Please feel free to submit your feedback here: http://connect.microsoft.com/Main/co...ContentID=2220. Regards, Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |