Sync with trunk r63174.
[reactos.git] / win32ss / gdi / gdi32 / objects / painting.c
1 #include <precomp.h>
2
3
4 /*
5 * @implemented
6 */
7 BOOL
8 WINAPI
9 LineTo( HDC hDC, INT x, INT y )
10 {
11 #if 0
12 // Handle something other than a normal dc object.
13 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
14 {
15 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
16 return MFDRV_MetaParam2( hDC, META_LINETO, x, y);
17 else
18 {
19 PLDC pLDC = GdiGetLDC(hDC);
20 if ( !pLDC )
21 {
22 SetLastError(ERROR_INVALID_HANDLE);
23 return FALSE;
24 }
25 if (pLDC->iType == LDC_EMFLDC)
26 {
27 return MFDRV_LineTo( hDC, x, y )
28 }
29 return FALSE;
30 }
31 }
32 #endif
33 return NtGdiLineTo( hDC, x, y);
34 }
35
36
37 BOOL
38 WINAPI
39 MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
40 {
41 PDC_ATTR Dc_Attr;
42 #if 0
43 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
44 {
45 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
46 return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
47 else
48 {
49 PLDC pLDC = Dc_Attr->pvLDC;
50 if ( !pLDC )
51 {
52 SetLastError(ERROR_INVALID_HANDLE);
53 return FALSE;
54 }
55 if (pLDC->iType == LDC_EMFLDC)
56 {
57 if (!EMFDRV_MoveTo( hDC, x, y)) return FALSE;
58 }
59 }
60 }
61 #endif
62 if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
63
64 if ( Point )
65 {
66 if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
67 {
68 Point->x = Dc_Attr->ptfxCurrent.x; // ret prev before change.
69 Point->y = Dc_Attr->ptfxCurrent.y;
70 DPtoLP ( hDC, Point, 1); // reconvert back.
71 }
72 else
73 {
74 Point->x = Dc_Attr->ptlCurrent.x;
75 Point->y = Dc_Attr->ptlCurrent.y;
76 }
77 }
78
79 Dc_Attr->ptlCurrent.x = x;
80 Dc_Attr->ptlCurrent.y = y;
81
82 Dc_Attr->ulDirty_ &= ~DIRTY_PTLCURRENT;
83 Dc_Attr->ulDirty_ |= ( DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); // Set dirty
84 return TRUE;
85 }
86
87
88 /*
89 * @implemented
90 */
91 BOOL
92 WINAPI
93 Ellipse(HDC hDC, INT Left, INT Top, INT Right, INT Bottom)
94 {
95 #if 0
96 // Handle something other than a normal dc object.
97 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
98 {
99 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
100 return MFDRV_MetaParam4(hDC, META_ELLIPSE, Left, Top, Right, Bottom );
101 else
102 {
103 PLDC pLDC = GdiGetLDC(hDC);
104 if ( !pLDC )
105 {
106 SetLastError(ERROR_INVALID_HANDLE);
107 return FALSE;
108 }
109 if (pLDC->iType == LDC_EMFLDC)
110 {
111 return EMFDRV_Ellipse( hDC, Left, Top, Right, Bottom );
112 }
113 return FALSE;
114 }
115 }
116 #endif
117 return NtGdiEllipse( hDC, Left, Top, Right, Bottom);
118 }
119
120
121 /*
122 * @implemented
123 */
124 BOOL
125 WINAPI
126 Rectangle(HDC hDC, INT Left, INT Top, INT Right, INT Bottom)
127 {
128 #if 0
129 // Handle something other than a normal dc object.
130 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
131 {
132 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
133 return MFDRV_MetaParam4(hDC, META_RECTANGLE, Left, Top, Right, Bottom );
134 else
135 {
136 PLDC pLDC = GdiGetLDC(hDC);
137 if ( !pLDC )
138 {
139 SetLastError(ERROR_INVALID_HANDLE);
140 return FALSE;
141 }
142 if (pLDC->iType == LDC_EMFLDC)
143 {
144 return EMFDRV_Rectangle( hDC, Left, Top, Right, Bottom );
145 }
146 return FALSE;
147 }
148 }
149 #endif
150 return NtGdiRectangle( hDC, Left, Top, Right, Bottom);
151 }
152
153
154 /*
155 * @implemented
156 */
157 BOOL
158 WINAPI
159 RoundRect(HDC hDC, INT Left, INT Top, INT Right, INT Bottom,
160 INT ell_Width, INT ell_Height)
161 {
162 #if 0
163 // Handle something other than a normal dc object.
164 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
165 {
166 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
167 return MFDRV_MetaParam6( hDC, META_ROUNDRECT, Left, Top, Right, Bottom,
168 ell_Width, ell_Height );
169 else
170 {
171 PLDC pLDC = GdiGetLDC(hDC);
172 if ( !pLDC )
173 {
174 SetLastError(ERROR_INVALID_HANDLE);
175 return FALSE;
176 }
177 if (pLDC->iType == LDC_EMFLDC)
178 {
179 return EMFDRV_RoundRect( hDC, Left, Top, Right, Bottom,
180 ell_Width, ell_Height );
181 }
182 return FALSE;
183 }
184 }
185 #endif
186 return NtGdiRoundRect( hDC, Left, Top, Right, Bottom, ell_Width, ell_Height);
187 }
188
189
190 /*
191 * @implemented
192 */
193 COLORREF
194 WINAPI
195 GetPixel( HDC hDC, INT x, INT y )
196 {
197 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) return CLR_INVALID;
198 if (!GdiIsHandleValid((HGDIOBJ) hDC)) return CLR_INVALID;
199 return NtGdiGetPixel( hDC, x, y);
200 }
201
202
203 /*
204 * @implemented
205 */
206 COLORREF
207 WINAPI
208 SetPixel( HDC hDC, INT x, INT y, COLORREF Color )
209 {
210 #if 0
211 // Handle something other than a normal dc object.
212 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
213 {
214 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
215 return MFDRV_MetaParam4(hDC, META_SETPIXEL, x, y, HIWORD(Color),
216 LOWORD(Color));
217 else
218 {
219 PLDC pLDC = GdiGetLDC(hDC);
220 if ( !pLDC )
221 {
222 SetLastError(ERROR_INVALID_HANDLE);
223 return 0;
224 }
225 if (pLDC->iType == LDC_EMFLDC)
226 {
227 return EMFDRV_SetPixel( hDC, x, y, Color );
228 }
229 return 0;
230 }
231 }
232 #endif
233 return NtGdiSetPixel( hDC, x, y, Color);
234 }
235
236
237 /*
238 * @implemented
239 */
240 BOOL
241 WINAPI
242 SetPixelV( HDC hDC, INT x, INT y, COLORREF Color )
243 {
244 COLORREF Cr = SetPixel( hDC, x, y, Color );
245 if (Cr != CLR_INVALID) return TRUE;
246 return FALSE;
247 }
248
249
250 /*
251 * @implemented
252 */
253 BOOL
254 WINAPI
255 FillRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush )
256 {
257
258 if ( (!hRgn) || (!hBrush) ) return FALSE;
259 #if 0
260 // Handle something other than a normal dc object.
261 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
262 {
263 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
264 return MFDRV_FillRgn( hDC, hRgn, hBrush);
265 else
266 {
267 PLDC pLDC = GdiGetLDC(hDC);
268 if ( !pLDC )
269 {
270 SetLastError(ERROR_INVALID_HANDLE);
271 return FALSE;
272 }
273 if (pLDC->iType == LDC_EMFLDC)
274 {
275 return EMFDRV_FillRgn(( hDC, hRgn, hBrush);
276 }
277 return FALSE;
278 }
279 }
280 #endif
281 return NtGdiFillRgn( hDC, hRgn, hBrush);
282 }
283
284
285 /*
286 * @implemented
287 */
288 BOOL
289 WINAPI
290 FrameRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush, INT nWidth, INT nHeight )
291 {
292
293 if ( (!hRgn) || (!hBrush) ) return FALSE;
294 #if 0
295 // Handle something other than a normal dc object.
296 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
297 {
298 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
299 return MFDRV_FrameRgn( hDC, hRgn, hBrush, nWidth, nHeight );
300 else
301 {
302 PLDC pLDC = GdiGetLDC(hDC);
303 if ( !pLDC )
304 {
305 SetLastError(ERROR_INVALID_HANDLE);
306 return FALSE;
307 }
308 if (pLDC->iType == LDC_EMFLDC)
309 {
310 return EMFDRV_FrameRgn( hDC, hRgn, hBrush, nWidth, nHeight );
311 }
312 return FALSE;
313 }
314 }
315 #endif
316 return NtGdiFrameRgn( hDC, hRgn, hBrush, nWidth, nHeight);
317 }
318
319
320 /*
321 * @implemented
322 */
323 BOOL
324 WINAPI
325 InvertRgn( HDC hDC, HRGN hRgn )
326 {
327
328 if ( !hRgn ) return FALSE;
329 #if 0
330 // Handle something other than a normal dc object.
331 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
332 {
333 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
334 return MFDRV_InvertRgn( hDC, HRGN hRgn ); // Use this instead of MFDRV_MetaParam.
335 else
336 {
337 PLDC pLDC = GdiGetLDC(hDC);
338 if ( !pLDC )
339 {
340 SetLastError(ERROR_INVALID_HANDLE);
341 return FALSE;
342 }
343 if (pLDC->iType == LDC_EMFLDC)
344 {
345 return EMFDRV_PaintInvertRgn( hDC, hRgn, EMR_INVERTRGN );
346 }
347 return FALSE;
348 }
349 }
350 #endif
351 return NtGdiInvertRgn( hDC, hRgn);
352 }
353
354
355 /*
356 * @implemented
357 */
358 BOOL
359 WINAPI
360 PaintRgn( HDC hDC, HRGN hRgn )
361 {
362 #if 0
363 // Handle something other than a normal dc object.
364 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
365 {
366 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
367 return MFDRV_PaintRgn( hDC, HRGN hRgn ); // Use this instead of MFDRV_MetaParam.
368 else
369 {
370 PLDC pLDC = GdiGetLDC(hDC);
371 if ( !pLDC )
372 {
373 SetLastError(ERROR_INVALID_HANDLE);
374 return FALSE;
375 }
376 if (pLDC->iType == LDC_EMFLDC)
377 {
378 return EMFDRV_PaintInvertRgn( hDC, hRgn, EMR_PAINTRGN );
379 }
380 return FALSE;
381 }
382 }
383 #endif
384 // Could just use Dc_Attr->hbrush? No.
385 HBRUSH hBrush = (HBRUSH)GetCurrentObject(hDC, OBJ_BRUSH);
386
387 return NtGdiFillRgn( hDC, hRgn, hBrush);
388 }
389
390
391 /*
392 * @implemented
393 */
394 BOOL
395 WINAPI
396 PolyBezier(HDC hDC ,const POINT* Point, DWORD cPoints)
397 {
398 #if 0
399 // Handle something other than a normal dc object.
400 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
401 {
402 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
403 /*
404 * Since MetaFiles don't record Beziers and they don't even record
405 * approximations to them using lines.
406 */
407 return FALSE;
408 else
409 {
410 PLDC pLDC = GdiGetLDC(hDC);
411 if ( !pLDC )
412 {
413 SetLastError(ERROR_INVALID_HANDLE);
414 return FALSE;
415 }
416 if (pLDC->iType == LDC_EMFLDC)
417 {
418 return FALSE; // Not supported yet.
419 }
420 return FALSE;
421 }
422 }
423 #endif
424 return NtGdiPolyPolyDraw( hDC ,(PPOINT) Point, &cPoints, 1, GdiPolyBezier );
425 }
426
427
428 /*
429 * @implemented
430 */
431 BOOL
432 WINAPI
433 PolyBezierTo(HDC hDC, const POINT* Point ,DWORD cPoints)
434 {
435 #if 0
436 // Handle something other than a normal dc object.
437 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
438 {
439 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
440 return FALSE;
441 else
442 {
443 PLDC pLDC = GdiGetLDC(hDC);
444 if ( !pLDC )
445 {
446 SetLastError(ERROR_INVALID_HANDLE);
447 return FALSE;
448 }
449 if (pLDC->iType == LDC_EMFLDC)
450 {
451 return FALSE; // Not supported yet.
452 }
453 return FALSE;
454 }
455 }
456 #endif
457 return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, &cPoints, 1, GdiPolyBezierTo );
458 }
459
460
461 /*
462 * @implemented
463 */
464 BOOL
465 WINAPI
466 PolyDraw(HDC hDC, const POINT* Point, const BYTE *lpbTypes, int cCount )
467 {
468 #if 0
469 // Handle something other than a normal dc object.
470 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
471 {
472 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
473 return FALSE;
474 else
475 {
476 PLDC pLDC = GdiGetLDC(hDC);
477 if ( !pLDC )
478 {
479 SetLastError(ERROR_INVALID_HANDLE);
480 return FALSE;
481 }
482 if (pLDC->iType == LDC_EMFLDC)
483 {
484 return FALSE; // Not supported yet.
485 }
486 return FALSE;
487 }
488 }
489 #endif
490 return NtGdiPolyDraw( hDC , (PPOINT) Point, (PBYTE)lpbTypes, cCount );
491 }
492
493
494 /*
495 * @implemented
496 */
497 BOOL
498 WINAPI
499 Polygon(HDC hDC, const POINT *Point, int Count)
500 {
501 #if 0
502 // Handle something other than a normal dc object.
503 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
504 {
505 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
506 return MFDRV_Polygon( hDC, Point, Count );
507 else
508 {
509 PLDC pLDC = GdiGetLDC(hDC);
510 if ( !pLDC )
511 {
512 SetLastError(ERROR_INVALID_HANDLE);
513 return FALSE;
514 }
515 if (pLDC->iType == LDC_EMFLDC)
516 {
517 return EMFDRV_Polygon( hDC, Point, Count );
518 }
519 return FALSE;
520 }
521 }
522 #endif
523 return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, (PULONG)&Count, 1, GdiPolyPolygon );
524 }
525
526
527 /*
528 * @implemented
529 */
530 BOOL
531 WINAPI
532 Polyline(HDC hDC, const POINT *Point, int Count)
533 {
534 #if 0
535 // Handle something other than a normal dc object.
536 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
537 {
538 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
539 return MFDRV_Polyline( hDC, Point, Count );
540 else
541 {
542 PLDC pLDC = GdiGetLDC(hDC);
543 if ( !pLDC )
544 {
545 SetLastError(ERROR_INVALID_HANDLE);
546 return FALSE;
547 }
548 if (pLDC->iType == LDC_EMFLDC)
549 {
550 return EMFDRV_Polyline( hDC, Point, Count );
551 }
552 return FALSE;
553 }
554 }
555 #endif
556 return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, (PULONG)&Count, 1, GdiPolyPolyLine );
557 }
558
559
560 /*
561 * @implemented
562 */
563 BOOL
564 WINAPI
565 PolylineTo(HDC hDC, const POINT* Point, DWORD Count)
566 {
567 #if 0
568 // Handle something other than a normal dc object.
569 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
570 {
571 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
572 return FALSE;
573 else
574 {
575 PLDC pLDC = GdiGetLDC(hDC);
576 if ( !pLDC )
577 {
578 SetLastError(ERROR_INVALID_HANDLE);
579 return FALSE;
580 }
581 if (pLDC->iType == LDC_EMFLDC)
582 {
583 return FALSE; // Not supported yet.
584 }
585 return FALSE;
586 }
587 }
588 #endif
589 return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, &Count, 1, GdiPolyLineTo );
590 }
591
592
593 /*
594 * @implemented
595 */
596 BOOL
597 WINAPI
598 PolyPolygon(HDC hDC, const POINT* Point, const INT* Count, int Polys)
599 {
600 #if 0
601 // Handle something other than a normal dc object.
602 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
603 {
604 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
605 return MFDRV_PolyPolygon( hDC, Point, Count, Polys);
606 else
607 {
608 PLDC pLDC = GdiGetLDC(hDC);
609 if ( !pLDC )
610 {
611 SetLastError(ERROR_INVALID_HANDLE);
612 return FALSE;
613 }
614 if (pLDC->iType == LDC_EMFLDC)
615 {
616 return EMFDRV_PolyPolygon( hDC, Point, Count, Polys );
617 }
618 return FALSE;
619 }
620 }
621 #endif
622 return NtGdiPolyPolyDraw( hDC , (PPOINT)Point, (PULONG)Count, Polys, GdiPolyPolygon );
623 }
624
625
626 /*
627 * @implemented
628 */
629 BOOL
630 WINAPI
631 PolyPolyline(HDC hDC, const POINT* Point, const DWORD* Counts, DWORD Polys)
632 {
633 #if 0
634 // Handle something other than a normal dc object.
635 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
636 {
637 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
638 return FALSE;
639 else
640 {
641 PLDC pLDC = GdiGetLDC(hDC);
642 if ( !pLDC )
643 {
644 SetLastError(ERROR_INVALID_HANDLE);
645 return FALSE;
646 }
647 if (pLDC->iType == LDC_EMFLDC)
648 {
649 return EMFDRV_PolyPolyline(hDC, Point, Counts, Polys);
650 }
651 return FALSE;
652 }
653 }
654 #endif
655 return NtGdiPolyPolyDraw( hDC , (PPOINT)Point, (PULONG)Counts, Polys, GdiPolyPolyLine );
656 }
657
658
659 /*
660 * @implemented
661 */
662 BOOL
663 WINAPI
664 ExtFloodFill(
665 HDC hDC,
666 int nXStart,
667 int nYStart,
668 COLORREF crFill,
669 UINT fuFillType
670 )
671 {
672 #if 0
673 // Handle something other than a normal dc object.
674 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
675 {
676 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
677 return MFDRV_ExtFloodFill( hDC, nXStart, nYStart, crFill, fuFillType );
678 else
679 {
680 PLDC pLDC = GdiGetLDC(hDC);
681 if ( !pLDC )
682 {
683 SetLastError(ERROR_INVALID_HANDLE);
684 return FALSE;
685 }
686 if (pLDC->iType == LDC_EMFLDC)
687 {
688 return EMFDRV_ExtFloodFill( hDC, nXStart, nYStart, crFill, fuFillType );
689 }
690 return FALSE;
691 }
692 }
693 #endif
694 return NtGdiExtFloodFill(hDC, nXStart, nYStart, crFill, fuFillType);
695 }
696
697
698 /*
699 * @implemented
700 */
701 BOOL
702 WINAPI
703 FloodFill(
704 HDC hDC,
705 int nXStart,
706 int nYStart,
707 COLORREF crFill)
708 {
709 return ExtFloodFill(hDC, nXStart, nYStart, crFill, FLOODFILLBORDER);
710 }
711
712
713 /*
714 * @implemented
715 */
716 BOOL WINAPI
717 MaskBlt(
718 HDC hdcDest,
719 INT nXDest,
720 INT nYDest,
721 INT nWidth,
722 INT nHeight,
723 HDC hdcSrc,
724 INT nXSrc,
725 INT nYSrc,
726 HBITMAP hbmMask,
727 INT xMask,
728 INT yMask,
729 DWORD dwRop)
730 {
731 return NtGdiMaskBlt(hdcDest,
732 nXDest,
733 nYDest,
734 nWidth,
735 nHeight,
736 hdcSrc,
737 nXSrc,
738 nYSrc,
739 hbmMask,
740 xMask,
741 yMask,
742 dwRop,
743 GetBkColor(hdcSrc));
744 }
745
746
747 /*
748 * @implemented
749 */
750 BOOL
751 WINAPI
752 PlgBlt(
753 HDC hdcDest,
754 const POINT *lpPoint,
755 HDC hdcSrc,
756 INT nXSrc,
757 INT nYSrc,
758 INT nWidth,
759 INT nHeight,
760 HBITMAP hbmMask,
761 INT xMask,
762 INT yMask)
763 {
764 return NtGdiPlgBlt(hdcDest,
765 (LPPOINT)lpPoint,
766 hdcSrc,
767 nXSrc,
768 nYSrc,
769 nWidth,
770 nHeight,
771 hbmMask,
772 xMask,
773 yMask,
774 GetBkColor(hdcSrc));
775 }