2 * FreeRDP: A Remote Desktop Protocol Client
5 * Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 /* GDI Brush Functions: http://msdn.microsoft.com/en-us/library/dd183395/ */
26 #include <freerdp/freerdp.h>
27 #include <freerdp/gdi/gdi.h>
29 #include <freerdp/gdi/32bpp.h>
30 #include <freerdp/gdi/16bpp.h>
31 #include <freerdp/gdi/8bpp.h>
33 #include <freerdp/gdi/brush.h>
45 * Create a new solid brush.\n
47 * @param crColor brush color
51 HGDI_BRUSH gdi_CreateSolidBrush(GDI_COLOR crColor)
53 HGDI_BRUSH hBrush = (HGDI_BRUSH) malloc(sizeof(GDI_BRUSH));
54 hBrush->objectType = GDIOBJECT_BRUSH;
55 hBrush->style = GDI_BS_SOLID;
56 hBrush->color = crColor;
61 * Create a new pattern brush.\n
63 * @param hbmp pattern bitmap
67 HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp)
69 HGDI_BRUSH hBrush = (HGDI_BRUSH) malloc(sizeof(GDI_BRUSH));
70 hBrush->objectType = GDIOBJECT_BRUSH;
71 hBrush->style = GDI_BS_PATTERN;
72 hBrush->pattern = hbmp;
77 * Perform a pattern blit operation on the given pixel buffer.\n
79 * @param hdc device context
83 * @param nHeight height
84 * @param rop raster operation code
85 * @return 1 if successful, 0 otherwise
88 int gdi_PatBlt(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, int rop)
90 p_PatBlt _PatBlt = PatBlt_[IBPP(hdc->bitsPerPixel)];
93 return _PatBlt(hdc, nXLeft, nYLeft, nWidth, nHeight, rop);