您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DC_LockDc函数代码示例

51自学网 2021-06-01 20:19:02
  C++
这篇教程C++ DC_LockDc函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DC_LockDc函数的典型用法代码示例。如果您正苦于以下问题:C++ DC_LockDc函数的具体用法?C++ DC_LockDc怎么用?C++ DC_LockDc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DC_LockDc函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DxEngLockDC

/*++* @name DxEngLockDC* @implemented** The function DxEngLockDC locks a hdc from dxg.sys** @param HDC hDC* The handle we want to lock** @return* Returns PDC if lock succeeded or NULL if it failed.** @remarks.* none**--*/PDCAPIENTRYDxEngLockDC(HDC hDC){    DPRINT1("ReactX Calling : DxEngLockDC/n");    return DC_LockDc(hDC);}
开发者ID:hoangduit,项目名称:reactos,代码行数:23,


示例2: NtGdiSetBrushOrg

BOOLAPIENTRYNtGdiSetBrushOrg(    _In_ HDC hdc,    _In_ INT x,    _In_ INT y,    _Out_opt_ LPPOINT pptOut){    PDC pdc;    /* Lock the DC */    pdc = DC_LockDc(hdc);    if (pdc == NULL)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return FALSE;    }    /* Check if the old origin was requested */    if (pptOut != NULL)    {        /* Enter SEH for buffer transfer */        _SEH2_TRY        {            /* Probe and copy the old origin */            ProbeForWrite(pptOut, sizeof(POINT), 1);            *pptOut = pdc->pdcattr->ptlBrushOrigin;        }        _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)        {            DC_UnlockDc(pdc);            _SEH2_YIELD(return FALSE);        }        _SEH2_END;    }
开发者ID:staring,项目名称:RosFE,代码行数:35,


示例3: IntGdiSetTextColor

COLORREFFASTCALLIntGdiSetTextColor(HDC hDC,                   COLORREF color){    COLORREF crOldColor;    PDC pdc;    PDC_ATTR pdcattr;    pdc = DC_LockDc(hDC);    if (!pdc)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return CLR_INVALID;    }    pdcattr = pdc->pdcattr;    crOldColor = (COLORREF) pdcattr->ulForegroundClr;    pdcattr->ulForegroundClr = (ULONG)color;    if (pdcattr->crForegroundClr != color)    {        pdcattr->ulDirty_ |= (DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL);        pdcattr->crForegroundClr = color;    }    DC_vUpdateTextBrush(pdc);    DC_UnlockDc(pdc);    return  crOldColor;}
开发者ID:Strongc,项目名称:reactos,代码行数:32,


示例4: GreSetBrushOrg

BOOL FASTCALLGreSetBrushOrg(    HDC hdc,    INT x,    INT y,    LPPOINT pptOut){    PDC pdc = DC_LockDc(hdc);    if (pdc == NULL)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return FALSE;    }    if (pptOut != NULL)    {        *pptOut = pdc->pdcattr->ptlBrushOrigin;    }    pdc->pdcattr->ptlBrushOrigin.x = x;    pdc->pdcattr->ptlBrushOrigin.y = y;    DC_vSetBrushOrigin(pdc, x, y);    DC_UnlockDc(pdc);    return TRUE;}
开发者ID:Moteesh,项目名称:reactos,代码行数:27,


示例5: IntGdiSetBkColor

COLORREF FASTCALLIntGdiSetBkColor(HDC hDC, COLORREF color){    COLORREF oldColor;    PDC dc;    PDC_ATTR pdcattr;    HBRUSH hBrush;    if (!(dc = DC_LockDc(hDC)))    {        EngSetLastError(ERROR_INVALID_HANDLE);        return CLR_INVALID;    }    pdcattr = dc->pdcattr;    oldColor = pdcattr->ulBackgroundClr;    pdcattr->ulBackgroundClr = color;    if (pdcattr->crBackgroundClr != color)    {        pdcattr->ulDirty_ |= (DIRTY_BACKGROUND|DIRTY_LINE|DIRTY_FILL); // Clear Flag if set.        pdcattr->crBackgroundClr = color;    }    hBrush = pdcattr->hbrush;    DC_UnlockDc(dc);    NtGdiSelectBrush(hDC, hBrush);    return oldColor;}
开发者ID:Moteesh,项目名称:reactos,代码行数:28,


示例6: IntGdiSetTextAlign

UINTFASTCALLIntGdiSetTextAlign(HDC  hDC,                   UINT  Mode){    UINT prevAlign;    DC *dc;    PDC_ATTR pdcattr;    dc = DC_LockDc(hDC);    if (!dc)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return GDI_ERROR;    }    pdcattr = dc->pdcattr;    prevAlign = pdcattr->lTextAlign;    pdcattr->lTextAlign = Mode;    if (pdcattr->dwLayout & LAYOUT_RTL)    {        if ((Mode & TA_CENTER) != TA_CENTER) Mode ^= TA_RIGHT;    }    pdcattr->flTextAlign = Mode & TA_MASK;    DC_UnlockDc(dc);    return  prevAlign;}
开发者ID:Moteesh,项目名称:reactos,代码行数:26,


示例7: IntGdiSetTextColor

COLORREFFASTCALLIntGdiSetTextColor(HDC hDC,                   COLORREF color){    COLORREF crOldColor;    PDC pdc;    PDC_ATTR pdcattr;    pdc = DC_LockDc(hDC);    if (!pdc)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return CLR_INVALID;    }    pdcattr = pdc->pdcattr;    // What about ulForegroundClr, like in gdi32?    crOldColor = pdcattr->crForegroundClr;    pdcattr->crForegroundClr = color;    DC_vUpdateTextBrush(pdc);    DC_UnlockDc(pdc);    return  crOldColor;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:26,


示例8: IntAnimatePalette

UINT APIENTRYIntAnimatePalette(HPALETTE hPal,                  UINT StartIndex,                  UINT NumEntries,                  CONST PPALETTEENTRY PaletteColors){    UINT ret = 0;    if( hPal != NtGdiGetStockObject(DEFAULT_PALETTE) )    {        PPALETTE palPtr;        UINT pal_entries;        HDC hDC;        PDC dc;        PWND Wnd;        const PALETTEENTRY *pptr = PaletteColors;        palPtr = PALETTE_ShareLockPalette(hPal);        if (!palPtr) return FALSE;        pal_entries = palPtr->NumColors;        if (StartIndex >= pal_entries)        {            PALETTE_ShareUnlockPalette(palPtr);            return FALSE;        }        if (StartIndex+NumEntries > pal_entries) NumEntries = pal_entries - StartIndex;        for (NumEntries += StartIndex; StartIndex < NumEntries; StartIndex++, pptr++)        {            /* According to MSDN, only animate PC_RESERVED colours */            if (palPtr->IndexedColors[StartIndex].peFlags & PC_RESERVED)            {                memcpy( &palPtr->IndexedColors[StartIndex], pptr,                        sizeof(PALETTEENTRY) );                ret++;                PALETTE_ValidateFlags(&palPtr->IndexedColors[StartIndex], 1);            }        }        PALETTE_ShareUnlockPalette(palPtr);        /* Immediately apply the new palette if current window uses it */        Wnd = UserGetDesktopWindow();        hDC =  UserGetWindowDC(Wnd);        dc = DC_LockDc(hDC);        if (NULL != dc)        {            if (dc->dclevel.hpal == hPal)            {                DC_UnlockDc(dc);                IntGdiRealizePalette(hDC);            }            else                DC_UnlockDc(dc);        }        UserReleaseDC(Wnd,hDC, FALSE);    }    return ret;}
开发者ID:hoangduit,项目名称:reactos,代码行数:60,


示例9: NtGdiOffsetClipRgn

int APIENTRY NtGdiOffsetClipRgn(HDC  hDC,                       int  XOffset,                       int  YOffset){  INT Result;  DC *dc;  if(!(dc = DC_LockDc(hDC)))  {    EngSetLastError(ERROR_INVALID_HANDLE);    return ERROR;  }  if(dc->rosdc.hClipRgn != NULL)  {    Result = NtGdiOffsetRgn(dc->rosdc.hClipRgn,                            XOffset,                            YOffset);    CLIPPING_UpdateGCRegion(dc);  }  else  {    Result = NULLREGION;  }  DC_UnlockDc(dc);  return Result;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:28,


示例10: IntGdiSetHookFlags

WORD APIENTRYIntGdiSetHookFlags(HDC hDC, WORD Flags){    WORD wRet;    DC *dc = DC_LockDc(hDC);    if (NULL == dc)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return 0;    }    wRet = dc->fs & DC_FLAG_DIRTY_RAO; // FIXME: Wrong flag!    /* Info in "Undocumented Windows" is slightly confusing. */    DPRINT("DC %p, Flags %04x/n", hDC, Flags);    if (Flags & DCHF_INVALIDATEVISRGN)    {        /* hVisRgn has to be updated */        dc->fs |= DC_FLAG_DIRTY_RAO;    }    else if (Flags & DCHF_VALIDATEVISRGN || 0 == Flags)    {        //dc->fs &= ~DC_FLAG_DIRTY_RAO;    }    DC_UnlockDc(dc);    return wRet;}
开发者ID:Strongc,项目名称:reactos,代码行数:31,


示例11: NtGdiSelectBrush

 /* * @implemented */HBRUSHAPIENTRYNtGdiSelectBrush(    IN HDC hDC,    IN HBRUSH hBrush){    PDC pDC;    HBRUSH hOrgBrush;    if (hDC == NULL || hBrush == NULL) return NULL;    pDC = DC_LockDc(hDC);    if (!pDC)    {        return NULL;    }    /* Simply return the user mode value, without checking */    hOrgBrush = pDC->pdcattr->hbrush;    pDC->pdcattr->hbrush = hBrush;    DC_vUpdateFillBrush(pDC);    DC_UnlockDc(pDC);    return hOrgBrush;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:29,


示例12: NtGdiSelectPen

 /* * @implemented */HPENAPIENTRYNtGdiSelectPen(    IN HDC hDC,    IN HPEN hPen){    PDC pDC;    HPEN hOrgPen;    if (hDC == NULL || hPen == NULL) return NULL;    pDC = DC_LockDc(hDC);    if (!pDC)    {        return NULL;    }    /* Simply return the user mode value, without checking */    hOrgPen = pDC->pdcattr->hpen;    pDC->pdcattr->hpen = hPen;    DC_vUpdateLineBrush(pDC);    DC_UnlockDc(pDC);    return hOrgPen;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:29,


示例13: GdiSelectVisRgn

INT FASTCALLGdiSelectVisRgn(HDC hdc, HRGN hrgn){  int retval;  DC *dc;  PREGION prgn;  if (!hrgn)  {  	EngSetLastError(ERROR_INVALID_PARAMETER);  	return ERROR;  }  if (!(dc = DC_LockDc(hdc)))  {  	EngSetLastError(ERROR_INVALID_HANDLE);  	return ERROR;  }  dc->fs &= ~DC_FLAG_DIRTY_RAO;  ASSERT (dc->prgnVis != NULL);  prgn = RGNOBJAPI_Lock(hrgn, NULL);  retval = prgn ? IntGdiCombineRgn(dc->prgnVis, prgn, NULL, RGN_COPY) : ERROR;  RGNOBJAPI_Unlock(prgn);  if ( retval != ERROR )  {    IntGdiOffsetRgn(dc->prgnVis, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y);    CLIPPING_UpdateGCRegion(dc);  }  DC_UnlockDc(dc);  return retval;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:34,


示例14: DceSetDrawable

static VOID APIENTRYDceSetDrawable( PWND Window OPTIONAL,                HDC hDC,                ULONG Flags,                BOOL SetClipOrigin){  DC *dc = DC_LockDc(hDC);  if(!dc)      return;  if (Window == NULL)  {      dc->ptlDCOrig.x = 0;      dc->ptlDCOrig.y = 0;  }  else  {      if (Flags & DCX_WINDOW)      {         dc->ptlDCOrig.x = Window->rcWindow.left;         dc->ptlDCOrig.y = Window->rcWindow.top;      }      else      {         dc->ptlDCOrig.x = Window->rcClient.left;         dc->ptlDCOrig.y = Window->rcClient.top;      }  }  dc->fs |= DC_FLAG_DIRTY_RAO;  DC_UnlockDc(dc);}
开发者ID:GYGit,项目名称:reactos,代码行数:31,


示例15: NtGdiExtSelectClipRgn

intAPIENTRYNtGdiExtSelectClipRgn(    HDC  hDC,    HRGN  hrgn,    int  fnMode){    int retval;    DC *dc;    PREGION prgn;    if (!(dc = DC_LockDc(hDC)))    {        EngSetLastError(ERROR_INVALID_HANDLE);        return ERROR;    }    prgn = REGION_LockRgn(hrgn);    if ((prgn == NULL) && (fnMode != RGN_COPY))    {        EngSetLastError(ERROR_INVALID_HANDLE);        retval = ERROR;    }    else    {        retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode);    }    if (prgn)        REGION_UnlockRgn(prgn);    DC_UnlockDc(dc);    return retval;}
开发者ID:GYGit,项目名称:reactos,代码行数:35,


示例16: GreGetKerningPairs

DWORDFASTCALLGreGetKerningPairs(    HDC hDC,    ULONG NumPairs,    LPKERNINGPAIR krnpair){  PDC dc;  PDC_ATTR pdcattr;  PTEXTOBJ TextObj;  PFONTGDI FontGDI;  DWORD Count;  KERNINGPAIR *pKP;  dc = DC_LockDc(hDC);  if (!dc)  {     EngSetLastError(ERROR_INVALID_HANDLE);     return 0;  }  pdcattr = dc->pdcattr;  TextObj = RealizeFontInit(pdcattr->hlfntNew);  DC_UnlockDc(dc);  if (!TextObj)  {     EngSetLastError(ERROR_INVALID_HANDLE);     return 0;  }  FontGDI = ObjToGDI(TextObj->Font, FONT);  TEXTOBJ_UnlockText(TextObj);  Count = ftGdiGetKerningPairs(FontGDI,0,NULL);  if ( Count && krnpair )  {     if (Count > NumPairs)     {        EngSetLastError(ERROR_INSUFFICIENT_BUFFER);        return 0;     }     pKP = ExAllocatePoolWithTag(PagedPool, Count * sizeof(KERNINGPAIR), GDITAG_TEXT);     if (!pKP)     {        EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);        return 0;     }     ftGdiGetKerningPairs(FontGDI,Count,pKP);     RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));     ExFreePoolWithTag(pKP,GDITAG_TEXT);  }  return Count;}
开发者ID:GYGit,项目名称:reactos,代码行数:57,


示例17: IntGdiPolyPatBlt

BOOL FASTCALLIntGdiPolyPatBlt(    HDC hDC,    DWORD dwRop,    PPATRECT pRects,    INT cRects,    ULONG Reserved){    INT i;    PBRUSH pbrush;    PDC pdc;    EBRUSHOBJ eboFill;    pdc = DC_LockDc(hDC);    if (!pdc)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return FALSE;    }    if (pdc->dctype == DC_TYPE_INFO)    {        DC_UnlockDc(pdc);        /* Yes, Windows really returns TRUE in this case */        return TRUE;    }    for (i = 0; i < cRects; i++)    {        pbrush = BRUSH_ShareLockBrush(pRects->hBrush);        /* Check if we could lock the brush */        if (pbrush != NULL)        {            /* Initialize a brush object */            EBRUSHOBJ_vInitFromDC(&eboFill, pbrush, pdc);            IntPatBlt(                pdc,                pRects->r.left,                pRects->r.top,                pRects->r.right,                pRects->r.bottom,                dwRop,                &eboFill);            /* Cleanup the brush object and unlock the brush */            EBRUSHOBJ_vCleanup(&eboFill);            BRUSH_ShareUnlockBrush(pbrush);        }        pRects++;    }    DC_UnlockDc(pdc);    return TRUE;}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:57,


示例18: GdiGetClipBox

INT FASTCALLGdiGetClipBox(HDC hDC, PRECTL rc){   INT retval;   PDC dc;   PROSRGNDATA pRgnNew, pRgn = NULL;   BOOL Unlock = FALSE; //Small hack   if (!(dc = DC_LockDc(hDC)))   {      return ERROR;   }   /* FIXME! Rao and Vis only! */   if (dc->prgnAPI) // APIRGN   {      pRgn = dc->prgnAPI;   }   else if (dc->dclevel.prgnMeta) // METARGN   {      pRgn = dc->dclevel.prgnMeta;   }   else if (dc->rosdc.hClipRgn)   {	   Unlock = TRUE ;       pRgn = REGION_LockRgn(dc->rosdc.hClipRgn); // CLIPRGN   }   if (pRgn)   {      pRgnNew = IntSysCreateRectpRgn( 0, 0, 0, 0 );	  if (!pRgnNew)      {         DC_UnlockDc(dc);		 if(Unlock) REGION_UnlockRgn(pRgn);         return ERROR;      }      IntGdiCombineRgn(pRgnNew, dc->prgnVis, pRgn, RGN_AND);      retval = REGION_GetRgnBox(pRgnNew, rc);	  REGION_Delete(pRgnNew);      DC_UnlockDc(dc);	  if(Unlock) REGION_UnlockRgn(pRgn);      return retval;   }   retval = REGION_GetRgnBox(dc->prgnVis, rc);   IntDPtoLP(dc, (LPPOINT)rc, 2);   DC_UnlockDc(dc);   return retval;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:56,


示例19: NtGdiGetDeviceGammaRamp

BOOLAPIENTRYNtGdiGetDeviceGammaRamp(HDC  hDC,                             LPVOID  Ramp){  BOOL Ret;  PDC dc;  NTSTATUS Status = STATUS_SUCCESS;  PGAMMARAMP SafeRamp;  if (!Ramp) return FALSE;  dc = DC_LockDc(hDC);  if (!dc)  {     EngSetLastError(ERROR_INVALID_HANDLE);     return FALSE;  }  SafeRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM);  if (!SafeRamp)  {      DC_UnlockDc(dc);      EngSetLastError(STATUS_NO_MEMORY);      return FALSE;  }  Ret = IntGetDeviceGammaRamp((HDEV)dc->ppdev, SafeRamp);  if (!Ret) return Ret;  _SEH2_TRY  {     ProbeForWrite( Ramp,                    sizeof(PVOID),                    1);     RtlCopyMemory( Ramp,                    SafeRamp,                    sizeof(GAMMARAMP));  }  _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)  {     Status = _SEH2_GetExceptionCode();  }  _SEH2_END;  DC_UnlockDc(dc);  ExFreePoolWithTag(SafeRamp, GDITAG_ICM);  if (!NT_SUCCESS(Status))  {     SetLastNtError(Status);     return FALSE;  }  return Ret;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:56,


示例20: NtGdiPatBlt

BOOL APIENTRYNtGdiPatBlt(    HDC hDC,    INT XLeft,    INT YLeft,    INT Width,    INT Height,    DWORD ROP){    PBRUSH pbrush;    DC *dc;    PDC_ATTR pdcattr;    BOOL ret;    BOOL UsesSource = ROP_USES_SOURCE(ROP);    if (UsesSource)    {        /* In this case we call on GdiMaskBlt */        return NtGdiMaskBlt(hDC, XLeft, YLeft, Width, Height, 0,0,0,0,0,0,ROP,0);    }    dc = DC_LockDc(hDC);    if (dc == NULL)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return FALSE;    }    if (dc->dctype == DC_TYPE_INFO)    {        DC_UnlockDc(dc);        DPRINT1("NtGdiPatBlt on info DC!/n");        /* Yes, Windows really returns TRUE in this case */        return TRUE;    }    pdcattr = dc->pdcattr;    if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))        DC_vUpdateFillBrush(dc);    pbrush = BRUSH_ShareLockBrush(pdcattr->hbrush);    if (pbrush == NULL)    {        EngSetLastError(ERROR_INVALID_HANDLE);        DC_UnlockDc(dc);        return FALSE;    }    ret = IntPatBlt(dc, XLeft, YLeft, Width, Height, ROP, pbrush);    BRUSH_ShareUnlockBrush(pbrush);    DC_UnlockDc(dc);    return ret;}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:55,


示例21: NtGdiExcludeClipRect

int APIENTRY NtGdiExcludeClipRect(HDC  hDC,                         int  LeftRect,                         int  TopRect,                         int  RightRect,                         int  BottomRect){   INT Result;   RECTL Rect;   PREGION prgnNew, prgnClip;   PDC dc = DC_LockDc(hDC);   if (!dc)   {      EngSetLastError(ERROR_INVALID_HANDLE);      return ERROR;   }   Rect.left = LeftRect;   Rect.top = TopRect;   Rect.right = RightRect;   Rect.bottom = BottomRect;   IntLPtoDP(dc, (LPPOINT)&Rect, 2);   prgnNew = IntSysCreateRectpRgnIndirect(&Rect);   if (!prgnNew)   {      Result = ERROR;   }   else   {      if (!dc->rosdc.hClipRgn)      {         dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);         prgnClip = REGION_LockRgn(dc->rosdc.hClipRgn);         IntGdiCombineRgn(prgnClip, dc->prgnVis, prgnNew, RGN_DIFF);         REGION_UnlockRgn(prgnClip);         Result = SIMPLEREGION;      }      else      {         prgnClip = REGION_LockRgn(dc->rosdc.hClipRgn);         Result = IntGdiCombineRgn(prgnClip, prgnClip, prgnNew, RGN_DIFF);         REGION_UnlockRgn(prgnClip);      }      REGION_Delete(prgnNew);   }   if (Result != ERROR)      CLIPPING_UpdateGCRegion(dc);   DC_UnlockDc(dc);   return Result;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:54,


示例22: NtGdiSelectClipPath

BOOLAPIENTRYNtGdiSelectClipPath(    HDC hDC,    int Mode){    HRGN  hrgnPath;    PPATH pPath;    BOOL  success = FALSE;    PDC_ATTR pdcattr;    PDC pdc;    pdc = DC_LockDc(hDC);    if (!pdc)    {        EngSetLastError(ERROR_INVALID_PARAMETER);        return FALSE;    }    pdcattr = pdc->pdcattr;    pPath = PATH_LockPath(pdc->dclevel.hPath);    if (!pPath)    {        DC_UnlockDc(pdc);        return FALSE;    }    /* Check that path is closed */    if (pPath->state != PATH_Closed)    {        EngSetLastError(ERROR_CAN_NOT_COMPLETE);        DC_UnlockDc(pdc);        return FALSE;    }    /* Construct a region from the path */    else if (PATH_PathToRegion(pPath, pdcattr->jFillMode, &hrgnPath))    {        success = GdiExtSelectClipRgn(pdc, hrgnPath, Mode) != ERROR;        GreDeleteObject( hrgnPath );        /* Empty the path */        if (success)            PATH_EmptyPath(pPath);        /* FIXME: Should this function delete the path even if it failed? */    }    PATH_UnlockPath(pPath);    DC_UnlockDc(pdc);    return success;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:53,


示例23: GdiSelectPalette

HPALETTEFASTCALLGdiSelectPalette(    HDC hDC,    HPALETTE hpal,    BOOL ForceBackground){    PDC pdc;    HPALETTE oldPal = NULL;    PPALETTE ppal;    // FIXME: mark the palette as a [fore/back]ground pal    pdc = DC_LockDc(hDC);    if (!pdc)    {        return NULL;    }    /* Check if this is a valid palette handle */    ppal = PALETTE_ShareLockPalette(hpal);    if (!ppal)    {        DC_UnlockDc(pdc);        return NULL;    }    /* Is this a valid palette for this depth? */	if ((BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) <= 8					&& (ppal->flFlags & PAL_INDEXED)) ||			(BitsPerFormat(pdc->dclevel.pSurface->SurfObj.iBitmapFormat) > 8))    {        /* Get old palette, set new one */        oldPal = pdc->dclevel.hpal;        pdc->dclevel.hpal = hpal;        DC_vSelectPalette(pdc, ppal);        /* Mark the brushes invalid */        pdc->pdcattr->ulDirty_ |= DIRTY_FILL | DIRTY_LINE |                                  DIRTY_BACKGROUND | DIRTY_TEXT;    }    if(pdc->dctype == DCTYPE_MEMORY)    {        // This didn't work anyway        //IntGdiRealizePalette(hDC);    }    PALETTE_ShareUnlockPalette(ppal);    DC_UnlockDc(pdc);    return oldPal;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:52,


示例24: GreDPtoLP

BOOL FASTCALLGreDPtoLP(HDC hdc, LPPOINT lpPoints, INT nCount){   PDC dc;   if (!(dc = DC_LockDc(hdc)))   {      EngSetLastError(ERROR_INVALID_HANDLE);      return FALSE;   }   IntDPtoLP(dc, lpPoints, nCount);   DC_UnlockDc(dc);   return TRUE;}
开发者ID:Strongc,项目名称:reactos,代码行数:13,


示例25: NtGdiPatBlt

BOOLAPIENTRYNtGdiPatBlt(    _In_ HDC hdcDest,    _In_ INT x,    _In_ INT y,    _In_ INT cx,    _In_ INT cy,    _In_ DWORD dwRop){    BOOL bResult;    PDC pdc;    /* Mask away everything except foreground rop index */    dwRop = dwRop & 0x00FF0000;    dwRop |= dwRop << 8;    /* Check if the rop uses a source */    if (ROP_USES_SOURCE(dwRop))    {        /* This is not possible */        return 0;    }    /* Lock the DC */    pdc = DC_LockDc(hdcDest);    if (pdc == NULL)    {        EngSetLastError(ERROR_INVALID_HANDLE);        return FALSE;    }    /* Check if the DC has no surface (empty mem or info DC) */    if (pdc->dclevel.pSurface == NULL)    {        /* Nothing to do, Windows returns TRUE! */        DC_UnlockDc(pdc);        return TRUE;    }    /* Update the fill brush, if necessary */    if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))        DC_vUpdateFillBrush(pdc);    /* Call the internal function */    bResult = IntPatBlt(pdc, x, y, cx, cy, dwRop, &pdc->eboFill);    /* Unlock the DC and return the result */    DC_UnlockDc(pdc);    return bResult;}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:51,


示例26: GreGetMapMode

int FASTCALLGreGetMapMode(HDC hdc){   PDC dc;   INT iMapMode;   if (!(dc = DC_LockDc(hdc)))   {      EngSetLastError(ERROR_INVALID_HANDLE);      return CLR_INVALID;   }   iMapMode = dc->pdcattr->iMapMode;   DC_UnlockDc(dc);   return iMapMode;}
开发者ID:Strongc,项目名称:reactos,代码行数:14,


示例27: GreGetTextColor

COLORREF FASTCALLGreGetTextColor(HDC hdc){   PDC dc;   ULONG ulForegroundClr;   if (!(dc = DC_LockDc(hdc)))   {      EngSetLastError(ERROR_INVALID_HANDLE);      return CLR_INVALID;   }   ulForegroundClr = dc->pdcattr->ulForegroundClr;   DC_UnlockDc(dc);   return ulForegroundClr;}
开发者ID:Strongc,项目名称:reactos,代码行数:14,



注:本文中的DC_LockDc函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ DCondVar_Signal函数代码示例
C++ DC_Exit函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。