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

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

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

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

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

示例1: _ns_subsample_dialog_draw_icons

void _ns_subsample_dialog_draw_icons( NsSubsampleDialog *ssd )   {   HWND  wnd;   HDC   dc;   RECT  rc;   wnd = GetDlgItem( ssd->dlg, IDS_SUB_LOCK_XY );   dc  = GetDC( wnd );   GetClientRect( wnd, &rc );   if( ____ns_ssd_curr_fixed_all || ____ns_ssd_curr_fixed_width_height )      DrawIcon( dc, 0, 0, LoadIcon( ssd->instance, "LOCK_ICON" ) );   else      FillRect( dc, &rc, ( HBRUSH )( COLOR_3DFACE + 1 ) );   ReleaseDC( wnd, dc );   wnd = GetDlgItem( ssd->dlg, IDS_SUB_LOCK_YZ );   dc  = GetDC( wnd );   GetClientRect( wnd, &rc );   if( ____ns_ssd_curr_fixed_all )      DrawIcon( dc, 0, 0, LoadIcon( ssd->instance, "LOCK_ICON" ) );   else      FillRect( dc, &rc, ( HBRUSH )( COLOR_3DFACE + 1 ) );   ReleaseDC( wnd, dc );   }
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:31,


示例2: DrawiconWinProc

static int DrawiconWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam){    static HICON myicon_small, myicon_large;    HDC hdc;    switch (message) {    case MSG_CREATE:        myicon_small = LoadIconFromFile(HDC_SCREEN, "myicon.ico", 0);        if (myicon_small == 0)            fprintf (stderr, "Load icon file failure!");        myicon_large = LoadIconFromFile(HDC_SCREEN, "myicon.ico", 1);        if (myicon_large == 0)            fprintf (stderr, "Load icon file failure!");        break;    case MSG_PAINT:        hdc = BeginPaint(hWnd);        if (myicon_small != 0)            DrawIcon(hdc, 10, 10, 0, 0, myicon_small);        if (myicon_large != 0)            DrawIcon(hdc, 60, 60, 0, 0, myicon_large);        EndPaint(hWnd, hdc);        return 0;    case MSG_CLOSE:        DestroyIcon(myicon_small);        DestroyIcon(myicon_large);        DestroyMainWindow (hWnd);        PostQuitMessage (hWnd);        return 0;    }    return DefaultMainWinProc(hWnd, message, wParam, lParam);}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:34,


示例3: main

void main() {  int x0, y0;  int i = 0, j = 0;    int receive_block;  int image_to_draw;    receive_block = -1;  USBIP0_bit = 1;  USBIP1_bit = 1;  USBIP2_bit = 1;  USBIE_bit = 1;  EnableInterrupts();  Start_TP();    TFT_Fill_Screen(CL_WHITE);  TFT_Set_Font(TFT_defaultFont, CL_BLACK, FO_HORIZONTAL);    ClearBuffer(ReadBuffer, USB_LENGTH);  ClearBuffer(WriteBuffer, USB_LENGTH);  HID_Enable(ReadBuffer, &WriteBuffer);  for(i=0; i<2; i++) {      for(j=0; j<4; j++) {               DrawIcon(j, i);      }  }    while (1) {    Check_TP();    if (HID_Read()) {       ClearBuffer(WriteBuffer, USB_LENGTH);       if (strstr(ReadBuffer, "AT+SEND_IMAGE")) {            strcpy(WriteBuffer, "READY");            HID_Write(WriteBuffer,USB_LENGTH);           receive_block = 0;       }       else if ((receive_block>=0)&&(receive_block<2048)) {            memcpy((char *)Image_icon+receive_block, ReadBuffer, USB_LENGTH);            strcpy(WriteBuffer, "OK");            HID_Write(WriteBuffer,USB_LENGTH);            receive_block+=USB_LENGTH;       }              else if (strstr(&ReadBuffer, "AT+DRAW_IMAGE=")) {            image_to_draw = ReadBuffer[strlen("AT+DRAW_IMAGE=")]-'0';            DrawIcon(image_to_draw%4, image_to_draw/4);            strcpy(WriteBuffer, "OK");            HID_Write(WriteBuffer,USB_LENGTH);       }    }    ClearBuffer(&ReadBuffer, USB_LENGTH);    if(receive_block > 2048-USB_LENGTH) receive_block = -1;  }}
开发者ID:amaury10,项目名称:Pipboy,代码行数:60,


示例4: DrawIcon

void DemoState::DrawIcons() {  for (size_t i = 0; i < channel_icons_.size(); ++i) {    DrawIcon(channel_icons_[i], channel_texture_);  }  for (size_t i = 0; i < listener_icons_.size(); ++i) {    DrawIcon(listener_icons_[i], listener_texture_);  }}
开发者ID:WangCrystal,项目名称:pindrop,代码行数:8,


示例5: CreateMaterial

//-----------------------------------------------------------------------------// Purpose: // Input  : pDC - //			dstRect - //			detectErrors - //-----------------------------------------------------------------------------void CMaterial::DrawBrowserIcons( CDC *pDC, RECT& dstRect, bool detectErrors ){	static CMaterial* pTranslucentIcon = 0;	static CMaterial* pOpaqueIcon = 0;	static CMaterial* pSelfIllumIcon = 0;	static CMaterial* pBaseAlphaEnvMapMaskIcon = 0;	static CMaterial* pErrorIcon = 0;	if (!pTranslucentIcon)	{		pTranslucentIcon			= CreateMaterial("editor/translucenticon", true);		pOpaqueIcon					= CreateMaterial("editor/opaqueicon", true);		pSelfIllumIcon				= CreateMaterial("editor/selfillumicon", true);		pBaseAlphaEnvMapMaskIcon	= CreateMaterial("editor/basealphaenvmapmaskicon", true);		pErrorIcon					= CreateMaterial("editor/erroricon", true);		Assert( pTranslucentIcon && pOpaqueIcon && pSelfIllumIcon && pBaseAlphaEnvMapMaskIcon && pErrorIcon );	}	bool error = false;	IMaterial* pMaterial = GetMaterial();	if ( pMaterial->GetMaterialVarFlag( MATERIAL_VAR_TRANSLUCENT ) )	{		DrawIcon( pDC, pTranslucentIcon, dstRect );		if (detectErrors)		{			error = error || !m_TranslucentBaseTexture; 		}	}	else	{		DrawIcon( pDC, pOpaqueIcon, dstRect ); 	}	if ( pMaterial->GetMaterialVarFlag( MATERIAL_VAR_SELFILLUM ))	{		DrawIcon( pDC, pSelfIllumIcon, dstRect ); 		if (detectErrors)		{			error = error || !m_TranslucentBaseTexture;		}	}	if ( pMaterial->GetMaterialVarFlag( MATERIAL_VAR_BASEALPHAENVMAPMASK ))	{		DrawIcon( pDC, pBaseAlphaEnvMapMaskIcon, dstRect ); 		if (detectErrors)		{			error = error || !m_TranslucentBaseTexture;		}	}	if (error)	{		DrawIcon( pDC, pErrorIcon, dstRect );	}}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:64,


示例6: DrawShadow

void CImage::Draw(){    Math::Point     uv1,uv2, corner, pos, dim;    float       dp;    if ( (m_state & STATE_VISIBLE) == 0 )  return;    if ( m_state & STATE_SHADOW )    {        DrawShadow(m_pos, m_dim);    }    dp = 0.5f/256.0f;    if ( m_icon == 0 )  // hollow frame?    {        m_engine->SetTexture("button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x = 160.0f / 256.0f;        uv1.y = 192.0f / 256.0f;  // u-v texture        uv2.x = 192.0f / 256.0f;        uv2.y = 224.0f / 256.0f;        uv1.x += dp;        uv1.y += dp;        uv2.x -= dp;        uv2.y -= dp;        corner.x = 10.0f / 640.0f;        corner.y = 10.0f / 480.0f;        DrawIcon(m_pos, m_dim, uv1, uv2, corner, 8.0f/256.0f);    }    if ( m_filename[0] != 0 )  // displays an image?    {        m_engine->LoadTexture(m_filename);        m_engine->SetTexture(m_filename);        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        pos = m_pos;        dim = m_dim;        pos.x +=  5.0f / 640.0f;        pos.y +=  5.0f / 480.0f;        dim.x -= 10.0f / 640.0f;        dim.y -= 10.0f / 480.0f;        uv1.x = 0.0f;        uv1.y = 0.0f;        uv2.x = 1.0f;        uv2.y = 1.0f;        DrawIcon(pos, dim, uv1, uv2);    }}
开发者ID:DanielVartanov,项目名称:colobot,代码行数:49,


示例7: OnPaint

void OnPaint(HWND hWnd){   HDC dialogDC;   PAINTSTRUCT paint;   RECT cRC, textRC;   int i;   HBRUSH hBrush;   HPEN hPen;   HFONT dcFont;   COLORREF cr;   int nch = GetWindowTextW(windowList[selectedWindow], windowText, 1023);   dialogDC = BeginPaint(hWnd, &paint);   {      GetClientRect(hWnd, &cRC);      FillRect(dialogDC, &cRC, GetSysColorBrush(COLOR_MENU));      for(i=0; i< windowCount; i++)      {         HICON hIcon = iconList[i];                  int xpos = xOffset + 40 * (i % nCols);         int ypos = yOffset + 40 * (i / nCols);         if (selectedWindow == i)         {            hBrush = GetSysColorBrush(COLOR_HIGHLIGHT);         }         else         {            hBrush = GetSysColorBrush(COLOR_MENU);         }#if TRUE         cr = GetSysColor(COLOR_BTNTEXT); // doesn't look right! >_<         hPen = CreatePen(PS_DOT, 1, cr);         SelectObject(dialogDC, hPen);         SelectObject(dialogDC, hBrush);         Rectangle(dialogDC, xpos-2, ypos-2, xpos+32+2, ypos+32+2);         DeleteObject(hPen);         // Must NOT destroy the system brush!#else         RECT rc = { xpos-2, ypos-2, xpos+32+2, ypos+32+2 };         FillRect(dialogDC, &rc, hBrush);#endif         DrawIcon(dialogDC, xpos, ypos, hIcon);      }      dcFont = SelectObject(dialogDC, dialogFont);      SetTextColor(dialogDC, GetSysColor(COLOR_BTNTEXT));      SetBkColor(dialogDC, GetSysColor(COLOR_BTNFACE));      textRC.top = itemsH;      textRC.left = 8;      textRC.right = totalW - 8;      textRC.bottom = totalH - 8;      DrawTextW(dialogDC, windowText, nch, &textRC, DT_CENTER|DT_END_ELLIPSIS);      SelectObject(dialogDC, dcFont);   }   EndPaint(hWnd, &paint);}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:60,


示例8: WndProc

LRESULT WINAPI WndProc (HWND hWnd, UINT uMsg, WPARAM wp, LPARAM lp){		switch (uMsg)	{		case WM_PAINT:			PAINTSTRUCT ps;			HDC dc = BeginPaint (hWnd, &ps);						SelectObject (dc, GetStockObject (WHITE_BRUSH));			SelectObject (dc, GetStockObject (WHITE_PEN));			RECT rc;			GetClientRect (hWnd, &rc);			Rectangle (dc, rc.left, rc.top, rc.right, rc.bottom);			DrawIcon (dc, 5, 5, _Icon);			LPCSTR pszMsg = "Download was transferred to Free Download Manager.../nPlease use /"Back/" button to go back";			RECT rcT = rc;			rcT.left = 40; rcT.top = 5;			DrawText (dc, pszMsg, lstrlen (pszMsg), &rcT, DT_LEFT | DT_TOP);			EndPaint (hWnd, &ps);			return 0;			}	return DefWindowProc (hWnd, uMsg, wp, lp);}
开发者ID:ratever930,项目名称:freedownload,代码行数:26,


示例9: GetAmbientUserMode

HRESULT CDTDisplay::OnDrawAdvanced(ATL_DRAWINFO& di){	// TODO: Add your specialized code here and/or call the base class	BOOL bRunTime;	GetAmbientUserMode(bRunTime);	if(bRunTime)	{//Draw Picture here Display the image data in the		if(!m_DisplayImage.IsNull())		{			m_DisplayImage.Draw(di.hdcDraw,m_DrawRect,m_SrcRect);		}	}	else	{		OLE_COLOR colorOle; 		GetAmbientBackColor(colorOle); 		COLORREF colorRgb; 		::OleTranslateColor(colorOle,0,&colorRgb); 		HBRUSH hBrush; 		hBrush=CreateSolidBrush(colorRgb); 		RECT& rc = *(RECT*)di.prcBounds; 		FillRect(di.hdcDraw,&rc,hBrush); 		DeleteObject(hBrush); 		SetBkMode(di.hdcDraw,TRANSPARENT); 		HICON hIcon=LoadIcon(_AtlBaseModule.GetResourceInstance(),MAKEINTRESOURCE(IDI_DISPLAY)); 		DrawIcon(di.hdcDraw,rc.left,rc.top,hIcon); 		DeleteObject(hIcon);	}	return 0;	//return __super::OnDrawAdvanced(di);}
开发者ID:WildGenie,项目名称:ApponsControl,代码行数:31,


示例10: draw_cursor

static void draw_cursor(struct dc_capture *capture, HDC hdc){	HICON icon;	ICONINFO ii;	CURSORINFO *ci = &capture->ci;	if (!(capture->ci.flags & CURSOR_SHOWING))		return;	icon = CopyIcon(capture->ci.hCursor);	if (!icon)		return;	if (GetIconInfo(icon, &ii)) {		POINT pos;		pos.x = ci->ptScreenPos.x - (int)ii.xHotspot - capture->x;		pos.y = ci->ptScreenPos.y - (int)ii.yHotspot - capture->y;		DrawIcon(hdc, pos.x, pos.y, icon);		DeleteObject(ii.hbmColor);		DeleteObject(ii.hbmMask);	}	DestroyIcon(icon);}
开发者ID:GamingAtheist,项目名称:obs-studio,代码行数:26,


示例11: WndProc

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){    static HICON hIcon;    static int cxIcon, cyIcon, cxClient, cyClient;    HDC hdc;    HINSTANCE hInstance;    PAINTSTRUCT ps;    int x, y;    switch (message){        case WM_CREATE:            hInstance = ((LPCREATESTRUCT)lParam)->hInstance;            hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON));            cxIcon = GetSystemMetrics(SM_CXICON);            cyIcon = GetSystemMetrics(SM_CYICON);            return 0;        case WM_SIZE:            cxClient = LOWORD(lParam);            cyClient = HIWORD(lParam);            return 0;        case WM_PAINT:            hdc = BeginPaint(hwnd, &ps);            for(y=0; y<cyClient; y+=cyIcon)for(x=0; x<cxClient; x+=cxIcon)                DrawIcon(hdc, x, y, hIcon);            EndPaint(hwnd, &ps);            return 0;        case WM_DESTROY:            PostQuitMessage(0);            return 0;    }    return DefWindowProc(hwnd, message, wParam, lParam);}
开发者ID:tadvent,项目名称:LearningWinProgramming,代码行数:34,


示例12: ASSERT

voidBPose::DeselectWithoutErasingBackground(BRect, BPoseView* poseView){	ASSERT(poseView->ViewMode() != kListMode);	ASSERT(!IsSelected());	BPoint location(Location(poseView));	// draw icon directly	if (fPercent == -1)		DrawIcon(location, poseView, poseView->IconSize(), true);	else		UpdateIcon(location, poseView);	BColumn* column = poseView->FirstColumn();	if (column == NULL)		return;	BTextWidget* widget = WidgetFor(column->AttrHash());	if (widget == NULL || !widget->IsVisible())		return;	// just invalidate the background, don't draw anything	poseView->Invalidate(widget->CalcRect(location, 0, poseView));}
开发者ID:mylegacy,项目名称:haiku,代码行数:25,


示例13: DoDrawBolt

/* * Draws an icon at the coordinates x,y, after copying a saved bitmap back * onto the screen at the coordinates where the last icon was drawn and * saving the area under the icon to a DC in memory */void DoDrawBolt( int x, int y, icon_mover * mover)/************************************************/{    /*     * to make this look fast, even on slow machines, only redraw the icon     * when the x coordinate is a multiple of the bolt speed     * thus if speed = 5, the icon will be redrawn every 5th pixel it moves     */    if( x % mover->speed != 0 ) return;    /* if it is not the first iteration */    if( mover->last.x != -1 || mover->last.y != -1 ) {        /* redraw the area that the last icon covered */        BitBlt( mover->screen_dc, mover->last.x, mover->last.y, mover->size.x,                mover->size.y, mover->storage_dc, 0, 0, SRCCOPY);    }    /* save the area that will be under the icon to a DC in memory */    BitBlt( mover->storage_dc, 0, 0, mover->size.x, mover->size.y,            mover->screen_dc, x, y, SRCCOPY);    DrawIcon( mover->screen_dc, x, y, mover->icon );    /* save the coordinates for next time */    mover->last.x = x;    mover->last.y = y;} /* DoDrawBolt */
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:34,


示例14: DrawIcon

void CRBookmarkMenuItem::Draw( LVDrawBuf & buf, lvRect & rc, CRRectSkinRef skin, CRRectSkinRef valueSkin, bool selected ){    _itemDirty = false;    if ( !_bookmark ) {        CRMenuItem::Draw( buf, rc, skin, valueSkin, selected );        return;    }    lvRect itemBorders = skin->getBorderWidths();    skin->draw( buf, rc );    buf.SetTextColor( 0x000000 );    buf.SetBackgroundColor( 0xFFFFFF );    int imgWidth = DrawIcon( buf, rc, itemBorders );    lvRect textRect = rc;    textRect.left += imgWidth;    lvRect posRect = textRect;    lString16 text = _bookmark->getPosText();    if ( !text.empty() ) {        posRect.bottom = posRect.top + skin->getFont()->getHeight() + itemBorders.top + itemBorders.bottom;        textRect.top = posRect.bottom - itemBorders.bottom;    }    lString16 postext(_("Page $1 ($2%)"));    postext.replaceIntParam(1, _page+1);    postext.replaceParam(2, lString16::itoa( _bookmark->getPercent()/100 ) << "." << fmt::decimal(_bookmark->getPercent()%100));    postext << "  " << _bookmark->getTitleText();    skin->drawText( buf, posRect, postext );    if ( !text.empty() )        valueSkin->drawText( buf, textRect, text );}
开发者ID:Pokec,项目名称:pocketbook-coolreader,代码行数:29,


示例15: AddMouse

void AddMouse(HDC hMemDC, LPRECT lpRect, HDC hScrDC, HWND hwnd) {	POINT p;	// GetCursorPos(&p); // get current x, y 0.008 ms		CURSORINFO globalCursor;	globalCursor.cbSize = sizeof(CURSORINFO); // could cache I guess...	::GetCursorInfo(&globalCursor);	HCURSOR hcur = globalCursor.hCursor;	if(hwnd)	  ScreenToClient(hwnd, &p); // 0.010ms	else	  GetCursorPos(&p);	ICONINFO iconinfo;	BOOL ret = ::GetIconInfo(hcur, &iconinfo); // 0.09ms	if(ret) {		p.x -= iconinfo.xHotspot; // align mouse, I guess...		p.y -= iconinfo.yHotspot;		// avoid some memory leak or other...		if (iconinfo.hbmMask) {			::DeleteObject(iconinfo.hbmMask);		}		if (iconinfo.hbmColor) {			::DeleteObject(iconinfo.hbmColor);		}	}		DrawIcon(hMemDC, p.x-lpRect->left, p.y-lpRect->top, hcur); // 0.042ms}
开发者ID:MindFy,项目名称:camstudio,代码行数:33,


示例16: FVector

void AGameplayDebuggingHUDComponent::DrawOverHeadInformation(APlayerController* PC, class UGameplayDebuggingComponent *DebugComponent){#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)	APawn* MyPawn = Cast<APawn>(DebugComponent->GetSelectedActor());	const FVector Loc3d = MyPawn ? MyPawn->GetActorLocation() + FVector(0.f, 0.f, MyPawn->GetSimpleCollisionHalfHeight()) : FVector::ZeroVector;	if (OverHeadContext.Canvas->SceneView == NULL || OverHeadContext.Canvas->SceneView->ViewFrustum.IntersectBox(Loc3d, FVector::ZeroVector) == false)	{		return;	}	const FVector ScreenLoc = OverHeadContext.Canvas->Project(Loc3d);	static const FVector2D FontScale(1.f, 1.f);	UFont* Font = GEngine->GetSmallFont();	float TextXL = 0.f;	float YL = 0.f;	FString ObjectName = FString::Printf( TEXT("{yellow}%s {white}(%s)"), *DebugComponent->ControllerName, *DebugComponent->PawnName);	CalulateStringSize(OverHeadContext, OverHeadContext.Font, ObjectName, TextXL, YL);	bool bDrawFullOverHead = MyPawn != nullptr && GetDebuggingReplicator()->GetSelectedActorToDebug() == MyPawn;	float IconXLocation = OverHeadContext.DefaultX;	float IconYLocation = OverHeadContext.DefaultY;	if (bDrawFullOverHead)	{		OverHeadContext.DefaultX -= (0.5f*TextXL*FontScale.X);		OverHeadContext.DefaultY -= (1.2f*YL*FontScale.Y);		IconYLocation = OverHeadContext.DefaultY;		OverHeadContext.CursorX = OverHeadContext.DefaultX;		OverHeadContext.CursorY = OverHeadContext.DefaultY;	}	if (DebugComponent->DebugIcon.Len() > 0)	{		UTexture2D* RegularIcon = (UTexture2D*)StaticLoadObject(UTexture2D::StaticClass(), NULL, *DebugComponent->DebugIcon, NULL, LOAD_NoWarn | LOAD_Quiet, NULL);		if (RegularIcon)		{			FCanvasIcon Icon = UCanvas::MakeIcon(RegularIcon);			if (Icon.Texture)			{				const float DesiredIconSize = bDrawFullOverHead ? 32.f : 16.f;				DrawIcon(OverHeadContext, FColor::White, Icon, IconXLocation, IconYLocation - DesiredIconSize, DesiredIconSize / Icon.Texture->GetSurfaceWidth());			}		}	}	if (bDrawFullOverHead)	{		OverHeadContext.FontRenderInfo.bEnableShadow = bDrawFullOverHead;		PrintString(OverHeadContext, bDrawFullOverHead ? FColor::White : FColor(255, 255, 255, 128), FString::Printf(TEXT("%s/n"), *ObjectName));		OverHeadContext.FontRenderInfo.bEnableShadow = false;	}	if (EngineShowFlags.DebugAI)	{		DrawPath(PC, DebugComponent);	}#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:59,


示例17: DrawIcon

  bool LaserScanPlugin::Initialize(QGLWidget* canvas)  {    canvas_ = canvas;    DrawIcon();    return true;  }
开发者ID:evenator,项目名称:mapviz,代码行数:8,


示例18: DrawBackGround

void CIconButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){	CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC);	CRect rectItem = lpDrawItemStruct->rcItem;	// set up for double buffering	CDC dcMem;	dcMem.CreateCompatibleDC(pDC);	CBitmap bmp;	bmp.CreateCompatibleBitmap(pDC, rectItem.Width(), rectItem.Height());	CBitmap *pOldBitmap = dcMem.SelectObject(&bmp);	dcMem.SetBkMode(TRANSPARENT);	DrawBackGround(&dcMem);	// button state	BOOL bDrawFocusRect = !(lpDrawItemStruct->itemState & ODS_NOFOCUSRECT);	BOOL bIsFocused     = lpDrawItemStruct->itemState & ODS_FOCUS;	BOOL bIsPressed		= lpDrawItemStruct->itemState & ODS_SELECTED;	DWORD state = bIsPressed ? PBS_PRESSED : PBS_NORMAL;	if (state == PBS_NORMAL)	{		if (m_bhover)		{			state = PBS_HOT;		}	}	if(bIsPressed)	{		dcMem.FillSolidRect(&rectItem, RGB(0, 0, 155));	}	else if(bIsFocused)	{		dcMem.FillSolidRect(&rectItem, RGB(0, 155, 0));	}	if(m_hIcon)	{		DrawIcon(&dcMem, rectItem);	}	else if(m_bitmap.GetSafeHandle())	{		DrawBitmap(&dcMem, rectItem);	}	// end double buffering	pDC->BitBlt(0, 0, rectItem.Width(), rectItem.Height(),		&dcMem, 0, 0, SRCCOPY);	// swap back the original bitmap	dcMem.SelectObject(pOldBitmap);	bmp.DeleteObject();	dcMem.DeleteDC();}
开发者ID:lilingshui,项目名称:code-refrence,代码行数:58,


示例19: DrawIcon

  bool RoutePlugin::Initialize(QGLWidget* canvas)  {    canvas_ = canvas;    DrawIcon();    initialized_ = true;    return true;  }
开发者ID:lardemua,项目名称:mapviz,代码行数:9,


示例20: OnPaint

void OnPaint( HWND hWnd ){	PAINTSTRUCT ps = { 0 };	HDC hdc = BeginPaint( hWnd, &ps );	HICON hIcon = LoadIcon( g_hInstance, 						MAKEINTRESOURCE(IDI_ICON1) );	DrawIcon( hdc, 100, 100, hIcon );	EndPaint( hWnd, &ps );}
开发者ID:isongbo,项目名称:MyCode,代码行数:9,


示例21: DrawIconCentered

void DrawIconCentered(HDC hdc, RECT *pRect, HICON hIcon){	if (NULL != pRect)	{		int left=pRect->left + ((pRect->right-pRect->left)-32)/2;		int top= pRect-> top + ((pRect->bottom-pRect->top)-32)/2;		DrawIcon(hdc, left, top, hIcon);	}}
开发者ID:pbarot,项目名称:TicTacToe-game,代码行数:10,


示例22: if

void CSlider::DrawVertex(Math::Point pos, Math::Point dim, int icon){    Math::Point     uv1, uv2, corner;    float       ex, dp;    if ( icon == 0 )    {        m_engine->SetTexture("textures/interface/button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x =   0.0f/256.0f;  // yellow rectangle        uv1.y =  32.0f/256.0f;        uv2.x =  32.0f/256.0f;        uv2.y =  64.0f/256.0f;        corner.x = 2.0f/640.0f;        corner.y = 2.0f/480.0f;        ex = 4.0f/256.0f;    }    else if ( icon == 1 )    {        m_engine->SetTexture("textures/interface/button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x = 128.0f/256.0f;  // gray rectangle        uv1.y =  32.0f/256.0f;        uv2.x = 160.0f/256.0f;        uv2.y =  64.0f/256.0f;        corner.x = 2.0f/640.0f;        corner.y = 2.0f/480.0f;        ex = 4.0f/256.0f;    }    else    {        m_engine->SetTexture("textures/interface/button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x = 224.0f/256.0f;  // cursor        uv1.y =  32.0f/256.0f;        uv2.x = 256.0f/256.0f;        uv2.y =  64.0f/256.0f;        if ( !m_bHoriz )        {            uv1.y += 64.0f/256.0f;            uv2.y += 64.0f/256.0f;        }        corner.x = 2.0f/640.0f;        corner.y = 2.0f/480.0f;        ex = 4.0f/256.0f;    }    dp = 0.5f/256.0f;    uv1.x += dp;    uv1.y += dp;    uv2.x -= dp;    uv2.y -= dp;    DrawIcon(pos, dim, uv1, uv2, corner, ex);}
开发者ID:BTML,项目名称:colobot,代码行数:55,


示例23: DrawInsert

/*********************************************************************** *		DrawInsert (COMCTL32.15) * * Draws insert arrow by the side of the ListBox item in the parent window. * * RETURNS *      Nothing. */VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem){    RECT rcItem, rcListBox, rcDragIcon;    HDC hdc;    DRAGLISTDATA * data;    TRACE("(%p %p %d)/n", hwndParent, hwndLB, nItem);    if (!hDragArrow)        hDragArrow = LoadIconW(COMCTL32_hModule, (LPCWSTR)IDI_DRAGARROW);    if (LB_ERR == SendMessageW(hwndLB, LB_GETITEMRECT, nItem, (LPARAM)&rcItem))        return;    if (!GetWindowRect(hwndLB, &rcListBox))        return;    /* convert item rect to parent co-ordinates */    if (!MapWindowPoints(hwndLB, hwndParent, (LPPOINT)&rcItem, 2))        return;    /* convert list box rect to parent co-ordinates */    if (!MapWindowPoints(HWND_DESKTOP, hwndParent, (LPPOINT)&rcListBox, 2))        return;    rcDragIcon.left = rcListBox.left - DRAGICON_HOTSPOT_X;    rcDragIcon.top = rcItem.top - DRAGICON_HOTSPOT_Y;    rcDragIcon.right = rcListBox.left;    rcDragIcon.bottom = rcDragIcon.top + DRAGICON_HEIGHT;    if (!GetWindowSubclass(hwndLB, DragList_SubclassWindowProc, DRAGLIST_SUBCLASSID, (DWORD_PTR*)&data))        return;    if (nItem < 0)        SetRectEmpty(&rcDragIcon);    /* prevent flicker by only redrawing when necessary */    if (!EqualRect(&rcDragIcon, &data->last_drag_icon_rect))    {        /* get rid of any previous inserts drawn */        RedrawWindow(hwndParent, &data->last_drag_icon_rect, NULL,            RDW_INTERNALPAINT | RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);        CopyRect(&data->last_drag_icon_rect, &rcDragIcon);        if (nItem >= 0)        {            hdc = GetDC(hwndParent);            DrawIcon(hdc, rcDragIcon.left, rcDragIcon.top, hDragArrow);            ReleaseDC(hwndParent, hdc);        }    }}
开发者ID:GYGit,项目名称:reactos,代码行数:63,


示例24: if

void CScroll::DrawVertex(Math::Point pos, Math::Point dim, int icon){    Math::Point     uv1, uv2;    float       ex, dp;    if ( icon == 0 )    {        m_engine->SetTexture("textures/interface/button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x =   0.0f/256.0f;  // yellow rectangle        uv1.y =  32.0f/256.0f;        uv2.x =  32.0f/256.0f;        uv2.y =  64.0f/256.0f;        ex = 8.0f/256.0f;    }    else if ( icon == 1 )    {        m_engine->SetTexture("textures/interface/button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x = 128.0f/256.0f;  // gray rectangle        uv1.y =  32.0f/256.0f;        uv2.x = 160.0f/256.0f;        uv2.y =  64.0f/256.0f;        ex = 8.0f/256.0f;    }    else if ( icon == 2 )    {        m_engine->SetTexture("textures/interface/button1.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x =  64.0f/256.0f;  // blue rectangle        uv1.y =   0.0f/256.0f;        uv2.x =  96.0f/256.0f;        uv2.y =  32.0f/256.0f;        ex = 8.0f/256.0f;    }    else    {        m_engine->SetTexture("textures/interface/button2.png");        m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);        uv1.x = 104.0f/256.0f;  // blue line -        uv1.y =  32.0f/256.0f;        uv2.x = 128.0f/256.0f;        uv2.y =  40.0f/256.0f;        ex = 0.0f;    }    dp = 0.5f/256.0f;    uv1.x += dp;    uv1.y += dp;    uv2.x -= dp;    uv2.y -= dp;    DrawIcon(pos, dim, uv1, uv2, ex);}
开发者ID:CHmSID,项目名称:colobot,代码行数:54,


示例25: DrawIcon

void TicTacToeGame::DrawIconCentered(HDC hdc, RECT *pRect, HICON hIcon){	const int ICON_SIZE = 32;	if (NULL != pRect)	{		int left = pRect->left + ((pRect->right - pRect->left) - ICON_SIZE) / 2;		int top = pRect->top + ((pRect->bottom - pRect->top) - ICON_SIZE) / 2;		DrawIcon(hdc, left, top, hIcon);	}}
开发者ID:NamTe,项目名称:TicTacToe,代码行数:11,


示例26: DrawObject

//Blits object icon to the objects square and offset "center"//in the game area.void DrawObject(SDL_Surface *screen, struct object *obj){  SDL_Rect dest;  dest.x = obj->location.x * TILE_WIDTH;  dest.y = (14 - obj->location.y) * TILE_HEIGHT;  dest.w = TILE_WIDTH - 1;  dest.h = TILE_HEIGHT - 1;  DrawIcon(screen, obj->icon, dest.x + obj->center.x,	   dest.y + (TILE_HEIGHT - (1 + obj->center.y)));}
开发者ID:astine,项目名称:Gingerwar,代码行数:13,


示例27: if

 void RoutePlugin::SetDrawStyle(QString style) {   if (style == "lines")   {     draw_style_ = LINES;   }   else if (style == "points")   {     draw_style_ = POINTS;   }   DrawIcon(); }
开发者ID:lardemua,项目名称:mapviz,代码行数:12,


示例28: GetDC

void GEN::GameEngine::GameCycle(){	HDC   hDC;	// Draw the snowflake icon at random positions on the game screen	hDC = GetDC(m_hWindow);	int iX = rand() % GetWidth();	int iY = rand() % GetHeight();	DrawIcon(hDC, iX, iY,		(HICON)(WORD)GetClassLong(m_hWindow, GCL_HICON));	ReleaseDC(m_hWindow, hDC);}
开发者ID:jmacvey,项目名称:Win32GameEngine,代码行数:12,


示例29: drawPoint

voidModelMenuItem::DrawContent(){	if (fDrawText) {		BPoint drawPoint(ContentLocation());		drawPoint.x += 20 + (fExtraPad ? 6 : 0);		if (fHeightDelta > 0)			drawPoint.y += ceil(fHeightDelta / 2);		Menu()->MovePenTo(drawPoint);		_inherited::DrawContent();	}	DrawIcon();}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:13,



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


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