/[gr2lib]/trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs	2010/07/24 04:16:43	187
+++ trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs	2010/07/24 04:52:20	189
@@ -355,14 +355,13 @@
             #region Get GrannyABGR8888PixelFormat Layout
             get
             {
-                Layout _tmp_layout = granny_pixel_layouts.GrannyARGB8888PixelFormat;
-
+                Layout _tmp_layout = granny_pixel_layouts.GrannyARGB8888PixelFormat;               
                 unsafe
                 {
-                    IntPtr layoutPTR = (IntPtr)_tmp_layout.BytesPerPixel;
-                    _tmp_layout.NativePointer = layoutPTR;
+                    GCHandle layoutHandle = GCHandle.Alloc(_tmp_layout.BytesPerPixel, GCHandleType.Pinned);                    
+                    _tmp_layout.NativePointer = layoutHandle.AddrOfPinnedObject();
+                    layoutHandle.Free();
                 }            
-
                 int R = _tmp_layout.ShiftForComponent[1];
                 int B = _tmp_layout.ShiftForComponent[3];
 

 

  ViewVC Help
Powered by ViewVC 1.1.22