OSDN Git Service

作業部屋#50802 画面キャプチャができなくなっていた問題を暫定対応(F12キー固定で対応中)
[dtxmaniaxg-verk/dtxmaniaxg-verk-git.git] / SlimDXc_Jun2010(VC++2008) / source / direct2d / LayerParameters.cpp
1 /*
2 * Copyright (c) 2007-2010 SlimDX Group
3
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22 #include "stdafx.h"
23
24 #include <d2d1.h>
25 #include <d2d1helper.h>
26
27 #include "Direct2DException.h"
28
29 #include "LayerParameters.h"
30
31 using namespace System;
32
33 namespace SlimDX
34 {
35 namespace Direct2D
36 {
37         LayerParameters::LayerParameters()
38         {
39         }
40
41         D2D1_LAYER_PARAMETERS LayerParameters::ToUnmanaged()
42         {
43                 D2D1_LAYER_PARAMETERS params;
44                 params.contentBounds = D2D1::RectF( ContentBounds.Left, ContentBounds.Top, ContentBounds.Right, ContentBounds.Bottom );
45                 params.geometricMask = GeometricMask == nullptr ? NULL : GeometricMask->InternalPointer;
46                 params.maskAntialiasMode = static_cast<D2D1_ANTIALIAS_MODE>( AntialiasMode );
47                 params.opacity = Opacity;
48                 params.opacityBrush = OpacityBrush == nullptr ? NULL : OpacityBrush->InternalPointer;
49                 params.layerOptions = static_cast<D2D1_LAYER_OPTIONS>( LayerOptions );
50
51                 Matrix3x2 v = MaskTransform;
52                 memcpy( &params.maskTransform, &v, sizeof( D2D1_MATRIX_3X2_F ) );
53                 return params;
54         }
55 }
56 }