烛光摇曳的蛋糕(送给你们,谢谢你们)
经过了一段时间的学习,终于可以做出点东西,真是十分的高兴,谢谢你们,提供了一个这么好的学习机会,画一个蛋糕送给你们!!! 就是在画图的时候,
贴吧:easyx作者:魔尊第一楼 2013-03-31 18:11
新手求解...关于flappy bird源代码的一点问题......
从本吧下载的flappy bird源代码的一部分 #include <stdio.h> #include <graphics.h> int ini(void); int game(void); int ini(void) { in
贴吧:c语言作者:咪了你的喵 2014-04-05 17:33
回复:【MFC界面】去除Groupbox和radio button 文字背景色方法
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkMode(TRANSPARENT);
static HBRUSH m_hBrush = CreateSolidBrush(RGB(216, 216, 226)); //让Groupbox和radio button 文字背景与对话框背景色一致
return m_hBrush;
贴吧:lizhongjun作者:sysuser666 2013-02-21 09:10
回复:Static Text控件背景透明后文字重影不能刷新

设定STATIC控件背景透明
HBRUSH CPTZControlDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
     HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
    
     // TODO: Change any attributes of the DC here
    
    if(CTLCOLOR_STATIC == nCtlColor)   
     {
            pDC->SetBkMode(TRANSPARENT);   //设定背景透透明
         pDC->SetTextColor(RGB(0,0,0));//给文本框内的字体设定颜色
         CRect rect;
         pDC->FillSolidRect(&rect,RGB(255,255,255));
         return (HBRUSH)::GetStockObject(HOLLOW_BRUSH);   
     }
     // TODO: Return a different brush if the default is not desired
     return CreateSolidBrush(RGB(0,100,0));
}
贴吧:lizhongjun作者:124.207.145.* 2010-05-30 11:34
回复:Visual C++ 技巧集锦(一)

如何更新翻转背景颜色的文本
调用CDC:: SetBkmode并传送OPAQUE用当前的背景颜色填充背景,或者调用CDC::SetBkMode并传送TRANSPAARENT使背景保持不变,这两种方法都可以设置背景模式。下例设置背景模式为TRANSPARENT,可以两次更新串,用花色带黑阴影更新文本。黑色串在红色串之后,但由于设置了背景模式仍然可见。
void CSampleView:: OnDraw (CDC* pDC)
{
//Determint size of view.
CRect rcView
GetClientRect (rcVieew)
//Create sample string to display.
CString str (_T ("Awesome Shadow Text..."))
//Set the background mode to transparent.
pDC->SetBKMode (TRANSPARENT)
//Draw black shadow text.
rcView.OffsetRect (1, 1)
pDc->SetTextColor (RGB (0, 0, 0))
pDC->DrawText (str, str.GetLength (), rcView, DT_SINGLELINE | DT_CENTER | DT_VCENTER)
//Draw red text.
rcView.OffsetRect (-1,-1)
pDc->SetTextColor (RGB (255, 0, 0))
pDC->DrawText (str, str.GetLength (), rcView, DT_SINGLELINE | DT_CENTER | DT_VCENTER)
}

贴吧:程序员作者:清酒闲言 2011-10-24 11:24
回复:【Cong】我是隔壁素吧的,又来抓大叔了!!
void CColorProgress::OnPaint()
{
//CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
PAINTSTRUCT ps;
CDC* pDC = BeginPaint(&ps);//开始绘制
int nPos = GetPos();//获取当前进度条的位置
CRect clientRC;
GetClientRect(clientRC);//获取客户区域
pDC->SetBkMode(TRANSPARENT);//将设备上下文的背景模式设置为透明
int nMin, nMax;
GetRange(nMin, nMax);//获取进度条的显示范围
//获取单位刻度
double dFraction = (double)clientRC.Width() / (nMax-nMin);
int nLeft = nPos * dFraction;//计算左边距
CRect leftRC = clientRC;
leftRC.right = nLeft;
CRect rightRC = clientRC;
rightRC.left = nLeft;
for(int m=255;m>0;m--)
{
int x,y;
x = leftRC.Width() * m / 255;
pDC->FillRect(CRect(0,0,x,leftRC.Height()),&CBrush(RGB(255,m,0)));
}
pDC->FillRect(rightRC, &CBrush(RGB(255, 255, 255)));//使用白色标识剩余的部分
ReleaseDC(pDC);//释放设备上下文
EndPaint(&ps);//结束窗口绘制
// Do not call CProgressCtrl::OnPaint() for painting messages
}
贴吧:dnf圣骑士作者:取个名字真难sn 2014-10-27 16:58
回复:??这个是怎么实现的??
API 做的,代码如下:
.版本 2 .局部变量 hdc, 整数型
.局部变量 lf, LOGFONT
.局部变量 hf, 整数型
.局部变量 h, 整数型
.局部变量 hbk, 整数型
.局部变量 htext, 整数型
.局部变量 内容, 文本型 .如果真 (是否为正版)
返回 ()
.如果真结束
' 写出版权标记
hdc = 取设备场景_ (_取当前窗口 ())
lf.字符集 = 134
lf.字体名称 = “宋体”
lf.高度 = 32
hf = 使用指定属性创建逻辑字体_ (lf)
h = 选入设备场景_ (hdc, hf)
hbk = SetBkMode_ (hdc, 1)
htext = 设置前景色_ (hdc, #天蓝)
内容 = “Super-EC”
TextOut_ (hdc, 400, 35, 内容, 取文本长度 (内容))
SetBkMode_ (hdc, hbk)
设置前景色_ (hdc, htext)
选入设备场景_ (hdc, h)
删除对象_ (hf)
lf.加粗 = 200
lf.高度 = 16
hf = 使用指定属性创建逻辑字体_ (lf)
h = 选入设备场景_ (hdc, hf)
hbk = SetBkMode_ (hdc, 1)
htext = 设置前景色_ (hdc, 255)
内容 = “超级模块,让易语言编程更容易!”
TextOut_ (hdc, 525, 45, 内容, 取文本长度 (内容))
SetBkMode_ (hdc, hbk)
设置前景色_ (hdc, htext)
选入设备场景_ (hdc, h)
删除对象_ (hf)
释放设备场景_ (0, hdc)

贴吧:易语言作者:suicanhui 2012-03-25 14:29
回复:大神兄弟,,,我又出问题了,,我是新手,,就来帮帮我吧
#include <graphics.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
void main()
{
void start();
void help();
void about();
int y=160;
int n=60;
initgraph(611, 480);
setbkmode(TRANSPARENT);
IMAGE img; // 定义IMAGE 对象
loadimage(&img, "D:\\C语言实践\\开始界面\\BEIJING2.jpg"); // 读取图片到img 对象中
putimage(0, 0, &img); // 在坐标(0, 0) 位置显示IMAGE 对象
settextstyle(n, 0, "Comic Sans MS", 0, 0, FW_BOLD, false, false, false);
settextcolor(BLUE);
outtextxy(140,150,"start");
outtextxy(155,230,"help");
outtextxy(140,310,"about");
settextstyle(60, 0, "Broadway", 0, 0, FW_BOLD, false, false, false);
settextcolor(BLACK);
outtextxy(20,30,"Block Revolution");
settextcolor(YELLOW);
settextstyle(25, 0, "楷体", 0, 0, FW_BOLD, false, false, false);
outtextxy(50,450,"Please Click To Choose");
MOUSEMSG m; // 定义鼠标消息
while(true)
{
// 获取一条鼠标消息
m = GetMouseMsg();
switch(m.uMsg)
{
case WM_LBUTTONDOWN:
if(m.x>=140&&m.x<=250&&m.y<=220&&m.y>=150)
start();
if(m.x>=140&&m.x<=250&&m.y<=300&&m.y>=230)
help();
if(m.x>=140&&m.x<=250&&m.y<=380&&m.y>=310)
about();
}
Sleep(1);
}
getch();
closegraph();
}
void start()
{
setbkcolor(WHITE);// 设置背景色为浅灰色
cleardevice();//用背景色清空屏幕
setbkmode(TRANSPARENT);
IMAGE img3; // 定义IMAGE 对象
loadimage(&img3, "D:\\C语言实践\\开始界面\\YX1.jpg"); // 读取图片到img 对象中
putimage(0, 0, &img3); // 在坐标(0, 0) 位置显示IMAGE 对象
IMAGE img; // 定义IMAGE 对象
loadimage(&img, "D:\\C语言实践\\开始界面\\EZ1.jpg"); // 读取图片到img 对象中
putimage(0, 180, &img); // 在坐标(0, 0) 位置显示IMAGE 对象
settextstyle(20, 0, "Arial", 0, 0, FW_BOLD, false, false, false);
settextcolor(WHITE);
outtextxy(50,400,"Ezreal");
IMAGE img1; // 定义IMAGE 对象
loadimage(&img1, "D:\\C语言实践\\开始界面\\EZ3.jpg"); // 读取图片到img 对象中
putimage(160, 180, &img1); // 在坐标(0, 0) 位置显示IMAGE 对象
settextstyle(20, 0, "Arial", 0, 0, FW_BOLD, false, false, false);
settextcolor(WHITE);
outtextxy(200,400,"Garen");
IMAGE img4; // 定义IMAGE 对象
loadimage(&img4, "D:\\C语言实践\\开始界面\\HB.jpg"); // 读取图片到img 对象中
putimage(320, 180, &img4); // 在坐标(0, 0) 位置显示IMAGE 对象
settextstyle(20, 0, "Arial", 0, 0, FW_BOLD, false, false, false);
settextcolor(WHITE);
outtextxy(360,400,"Ashe");
IMAGE img5; // 定义IMAGE 对象
loadimage(&img5, "D:\\C语言实践\\开始界面\\BP.jpg"); // 读取图片到img 对象中
putimage(475, 180, &img5); // 在坐标(0, 0) 位置显示IMAGE 对象
settextstyle(20, 0, "Arial", 0, 0, FW_BOLD, false, false, false);
settextcolor(WHITE);
outtextxy(530,400,"Ziggs");
char c;
while(c != 27)
{
if (kbhit())
{
// 获取按键
c = getch();
{
switch(c)
{
case 'b':main();
case 'B':main();
case ' ':game();
}
}
}
}
Sleep(10000000);
}
void help()
{
setbkcolor(WHITE);// 设置背景色为浅灰色
cleardevice();//用背景色清空屏幕
setbkmode(TRANSPARENT);
settextstyle(40, 0, "宋体", 0, 0, FW_BOLD, false, false, false);
settextcolor(BLACK);
outtextxy(50,50,"按A左移");
outtextxy(50,100,"按D右移");
outtextxy(50,150,"按B返回");
Sleep(1000);
char c;
while(c != 27)
{
if (kbhit())
{
// 获取按键
c = getch();
{
switch(c)
{
case 'b':main();
case 'B':main();
}
}
}
}
}
void about()
{
int y=500;
setbkcolor(WHITE);// 设置背景色为浅灰色
cleardevice();//用背景色清空屏幕
setbkmode(TRANSPARENT);
IMAGE img2; // 定义IMAGE 对象
loadimage(&img2, "D:\\C语言实践\\开始界面\\EZ2.jpg"); // 读取图片到img 对象中
for(y=500;y>=0;y--)
{
Sleep(10);
putimage(0, y, &img2); // 在坐标(0, 0) 位置显示IMAGE 对
}
settextstyle(30, 0, "楷体", 0, 0, FW_BOLD, false, false, false);
settextcolor(LIGHTBLUE);
outtextxy(500,450,"按B返回");
char c;
while(c != 27)
{
if (kbhit())
{
// 获取按键
c = getch();
{
switch(c)
{
case 'b':main();
case 'B':main();
}
}
}
}
Sleep(10000000);
}
贴吧:easyx作者:天堂小嬲 2014-03-11 08:03
回复:自制游戏,神控代码
orzdlg.cpp
[cpp] view plain copy print?
// orzdlg.cpp : 实现文件
//
#include "stdafx.h"
#include "DotA_H4.h"
#include "orzdlg.h"
#include"time.h"
// Corzdlg 对话框
IMPLEMENT_DYNAMIC(Corzdlg, CDialog)
Corzdlg::Corzdlg(CWnd* pParent /*=NULL*/)
: CDialog(Corzdlg::IDD, pParent)
, godlike(0)
, choose(false)
, name(_T(""))
, m_nWidth(0)
{
}
Corzdlg::~Corzdlg()
{
}
void Corzdlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(Corzdlg, CDialog)
ON_WM_CREATE()
ON_WM_TIMER()
END_MESSAGE_MAP()
// Corzdlg 消息处理程序
int Corzdlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(1,100,NULL);
// TODO: 在此添加您专用的创建代码
if(choose==0)godlike=193;
else if(choose==1)godlike=230;
else if(choose==2)godlike=231;
else if(choose==3)godlike=237;
m_nWidth=0;
return 0;
}
void Corzdlg::OnTimer(UINT_PTR nIDEvent)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
if(choose==0){m_nWidth+=30;
CBitmap bitmap;
bitmap.LoadBitmapW(godlike++);
CBrush brush(&bitmap);
CClientDC dc(this);
dc.FillRect(CRect(0,0,600,300),&brush);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
CRect rect;
rect.left=100;
rect.top=240;
rect.right=m_nWidth;
rect.bottom=rect.top+tm.tmHeight;
dc.SetTextColor(RGB(255,0,0));
dc.SetBkMode(TRANSPARENT);
dc.DrawText(name,rect,DT_LEFT);
// dc.TextOut(200,250,name);
if(godlike==208)OnOK();
}
else if(choose==1)
{m_nWidth+=30;
CBitmap bitmap;
bitmap.LoadBitmapW(godlike--);
CBrush brush(&bitmap);
CClientDC dc(this);
dc.FillRect(CRect(0,0,600,300),&brush);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
CRect rect;
rect.left=100;
rect.top=240;
rect.right=m_nWidth;
rect.bottom=rect.top+tm.tmHeight;
dc.SetTextColor(RGB(255,0,0));
dc.SetBkMode(TRANSPARENT);
dc.DrawText(name,rect,DT_LEFT);
//dc.TextOut(200,250,name);
if(godlike==208)OnOK();
}
else if(choose==2)
{
m_nWidth+=100;
CBitmap bitmap;
bitmap.LoadBitmapW(godlike++);
CBrush brush(&bitmap);
CClientDC dc(this);
dc.FillRect(CRect(0,0,600,300),&brush);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
CRect rect;
rect.left=100;
rect.top=240;
rect.right=m_nWidth;
rect.bottom=rect.top+tm.tmHeight;
dc.SetTextColor(RGB(255,0,0));
dc.SetBkMode(TRANSPARENT);
dc.DrawText(name,rect,DT_LEFT);
//dc.TextOut(200,50,name);
if(godlike==236)OnOK();
}
else if(choose==3)
{m_nWidth+=30;
CBitmap bitmap;
bitmap.LoadBitmapW(godlike++);
CBrush brush(&bitmap);
CClientDC dc(this);
dc.FillRect(CRect(0,0,600,300),&brush);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
CRect rect;
rect.left=100;
rect.top=240;
rect.right=m_nWidth;
rect.bottom=rect.top+tm.tmHeight;
dc.SetTextColor(RGB(255,0,0));
dc.SetBkMode(TRANSPARENT);
dc.DrawText(name,rect,DT_LEFT);
//dc.TextOut(200,250,name);
if(godlike==256)OnOK();
}
CDialog::OnTimer(nIDEvent);
}
void Corzdlg::getkind(int num)
{
choose=num;
}
void Corzdlg::GetString(CString s)
{
name=s;
}
贴吧:平凡的沉默者作者:我爱吃草 2016-09-21 16:23
各位帮解答一下,新手入门
void CButtonDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) {      // TODO: Add your message handler code
贴吧:vc作者:社会民生杀手 2010-12-02 20:59

大家都在搜

  • Boot Mode
  • hotkey mode
  • god mode
  • ide mode
  • modesens
  • GOoBk
  • model s
  • Bk4815
  • Bk12u
  • Bk2425
  • Bk2762
  • Bk2802
  • ikon
  • BK2931
  • BK公司
  • BK是哪
  • BK是谁
  • DRIVEMODE