이를 위해 Common Control에서 "InteropBitmap"을 이용해 왔는데, 이것이 .net framework 과 연계되어 Control 에 Image Source 형식으로 붙을 수 있다는 점에서 WPF designer 이나 Brush Control 로 쉽게 코딩할 수 있는 Background 와 Blending 할 수 있겠다는 생각을 늘 해 왔다.
실제로 Native Engine 의 Rendering 결과가 RGBA 채널을 갖고 있고, A 채널 역시 계산되므로 .net framework의 기본 blending 을 활용할 수 있는 가능성이 높았다.
하여 그동안 다음과 같이 WPF designer 에서 Panel 의 Background 를 정의했었으나 Rendering 결과가 Blending 되지 않고 Background 부분이 Native의 RGB 색으로 (여기서는 검정) 다음과 같이 나왔다.
그러나 "InteropBitmap" 을 생성하는 코드를
bitmapSource = (InteropBitmap)Imaging.CreateBitmapSourceFromMemorySection(ipFileMapSection, iWidth, iHeight, PixelFormats.Bgr32, iRawStride, 0);다음과 같이 수정함으로써
bitmapSource = (InteropBitmap)Imaging.CreateBitmapSourceFromMemorySection(ipFileMapSection, iWidth, iHeight, PixelFormats.Bgra32, iRawStride, 0);
다음과 같이 세팅된 Panel에 대하여
이것이 의미하는 것은 Rendering 결과를 나타내는 component 에 .net framework 을 통해 쉽게 Background 를 지정하고 이것에 Blending 함으로써 전체적으로 완성도 높은 이미지를 도출할 수 있다는 것이다.
Thanks for Victory...
No comments:
Post a Comment