MFC中透明贴图
12345678910111213141516171819bool Draw(CPaintDC& dc){ int posx = GetAbsoluteLeft(); int posy = GetAbsoluteTop(); HDC MemDC;//一个环境设备 MemDC =CreateCompatibleDC(0);//得到一个兼容设备句柄 CImage image; image.Load("res//Arrow.bmp"); int w = image.GetWidth(); int h = image.GetHeight(); HBITMAP hbmp = image.Detach(); SelectObject(MemDC, hbmp);//把图片选择设备 // 设置RGB(255, 255, 255)为透明其它不透明 TransparentBlt(dc.m_hDC, posx, posy-14, GetFrameWidth()*2, GetFrameHeight( ...
lua实现的循环背景
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748local GameBackGround = class("GameBackGround", function() return display.newLayer("GameBackGround")end)GameBackGround.bk_ = {}GameBackGround.bkSize_ = 0function GameBackGround:ctor() self.bk_[0] = display.newSprite("main_bg_grass_left.jpg" , display.cx, display.cy) self.bk_[0]:setAnchorPoint(0,0) self.bk_[0]:setPosition(0,0) self:addChild(self.bk_[0]) ...
quick-lua创建骨骼动画
1234567891011121314151617181920local Skeleton = class("Skeleton", function() return display.newSprite()end)function Skeleton:ctor() -- 加载骨骼资源 ccs.ArmatureDataManager:getInstance():addArmatureFileInfo("cyborg.png", "cyborg.plist", "cyborg.xml") -- addArmatureFileInfo("png名","plist名","xml名字") -- 创建 local armature3 = ccs.Armature:create("cyborg") -- 骨骼名 armature3:getAnimation():play("run&q ...
lua模拟消息循环
lua模拟消息循环
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122--消息循环 单例--[[ --使用方法 local message = require("scripts.app.Node.MessageManager") message:PostMessage(message) num = time / dt message:PostDelayMessage(message, num) --检测并发送消息 message:UpdateManager_(dt)] ...
Sql触发器
12345678910create or replace trigger _trigger_name before insert or update on TABLE_NAME for each rowdeclare -- local variables herebegin :new.ID := SYS_GUID;end _trigger_name; -- 插入或更新数据后修改ID
写入程序数据库“.pdb”时出错
LINK : fatal error LNK1201: 写入程序数据库“F:\pb\proj.win32\Debug.win32\demo.pdb”时出错;请检查是否是磁盘空间不足、路径无效或权限不够调试->属性->c/c++修改调试信息格式为C7兼容。
cocos2d-x3.0新特性,与2.0的差别
cocos2d-x3.0新特性,与2.0的差别1234// cocos2d-x3.0发布说明https://github.com/fusijie/Cocos2d-x3.0-Release-Note// cocos2d-x3.0文档http://www.cocos2d-x.org/reference/native-cpp/V3.0/index.html
cocos2d-x移动淡出
123456789// cocos2d-x 2.2.3CCLabelTTF* pLabelTTF = CCLabelTTF::create( "abcdefghijklmn", "Arial", 40 );pLabelTTF->setPosition(ccp( 240, 20 ));pLabelTTF->setColor(ccc3(240, 222, 171));this->addChild(pLabelTTF);CCMoveBy* move = CCMoveBy::create(2, ccp(0,200)); // 相对移动动作CCFadeOut* fadeOut = CCFadeOut::create(2.0f); // 淡出动作CCFiniteTimeAction* fadeOutAct = CCSpawn::create(fadeOut, move,NULL); // 移动淡出同时执行pLabelTTF->runAction(fadeOutAct);
cocos2d-x文字移动
1234567// cocos2d-x文字移动CCLabelTTF* pLabelTTF = CCLabelTTF::create( "dcasfdsafdsa", "Arial", 40 );pLabelTTF->setPosition(ccp( 250, 20 ));pLabelTTF->setColor(ccc3(240, 222, 171));CCMoveTo *move = CCMoveTo::create(2.0f, ccp(0, 250));this->addChild(pLabelTTF);this->runAction(move);
水桶问题,所选水的体积之和刚好能盛满大桶
有一个大水桶,能盛放的水总容积为V,设有N个小桶的水,其容积分别为w1,w2,…,wn,希望从N个小桶中选择若干桶水倒入大桶中,所选水的体积之和刚好能盛满大桶,即水的体积之和等于V。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081#include <iiostream> using namespace std;// 明年十八岁const int N = 10;int W[N] = {0}; // 标记int V[N] = {0}; // 小桶装的水体积// 计算 v总体积,i小桶数量bool Func(int v, int i);// 打印输出void OutPut();// 初始化标记void InitW();// 初始化所有小水桶装水的体积void InitV(); in ...