DX9 DirectX鼠标控制程序 代码
代码实例1:
// @time: 2012.3.26
// @author: jadeshu
// des: DirectX鼠标控制程序
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <atlstr.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#define ReleaseD3D(x) if (x!=NULL){x->Release();x=NULL;}
#pragma comment(lib,"winmm.lib")
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dinput8.lib")
#pragma comment(lib, "dxguid.lib")
//全局变量
TCHAR g_szWindowName[]=_T("DirectX鼠标控制程序");
BOOL bActive = TRUE;
DIMOUSESTATE g_diMousestate={0};
//定义设备接口
IDirect3DDevice9 * g_pd3dDevice=NULL;
LPDIRECTINPUT8 g_pDirectInput=NULL; //DirectInput接口
LPDIRECTINPUTDEVICE8 g_pMouseDevice=NULL; //键盘输入接口
LPD3DXMESH g_pMeshTeapot=NULL; //茶壶网格对象
//回调函数声明
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
//初始化Direct3D函数声明
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance);
//渲染声明
VOID Render();
//清除对象声明
VOID Cleanup();
//读取设备的输入数据
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize);
//主函数
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
//定义窗口类结构
TCHAR szAppName[]=TEXT("ClassN");
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
ZeroMemory(&msg,sizeof(msg));
wc.cbClsExtra=0;
wc.cbSize=sizeof(WNDCLASSEX);
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hCursor=LoadCursor(hInstance,IDC_ARROW);
wc.hIcon=LoadIcon(hInstance,IDI_APPLICATION);
wc.hIconSm=NULL;
wc.hInstance=hInstance;
wc.lpfnWndProc=WinProc;
wc.lpszClassName=szAppName;
wc.lpszMenuName=NULL;
wc.style=CS_HREDRAW|CS_VREDRAW;
//注册窗口
RegisterClassEx(&wc);
//创建窗口
hwnd=CreateWindow(szAppName,g_szWindowName,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,0);
//加载3D初始化
if (FAILED(Init3D(hwnd,hInstance)))
{
return FALSE;
}
//显示和更新窗口
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
//消息循环
while (WM_QUIT!=msg.message)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
//转换消息
TranslateMessage(&msg);
//投递消息
DispatchMessage(&msg);
}
else if(bActive)
{
//渲染
Render();
}
else
{
if(!WaitMessage())
return -1;
}
}
//删除注册窗口
UnregisterClass(szAppName,hInstance);
return msg.wParam;
}
//回调函数
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch (uMsg)
{
case WM_PAINT:
Render(); //渲染
ValidateRect(hwnd,NULL); //更新窗口
return 0;
case WM_ACTIVATEAPP:
bActive = (BOOL)wParam;
break;
case WM_DESTROY:
Cleanup(); //清除对象
PostQuitMessage(0); //退出消息循环
return 0;
}
return DefWindowProc(hwnd,uMsg,wParam,lParam); //返回默认消息
}
//Direct3D初始化
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance)
{
IDirect3D9 *pD3D=NULL; //定义对象接口
pD3D=Direct3DCreate9(D3D_SDK_VERSION); //创建对象接口
if (NULL==pD3D)
{
return E_FAIL;
}
D3DCAPS9 caps; //获取硬件设备信息
int vp=0;
pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
if (caps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT)
{
vp=D3DCREATE_HARDWARE_VERTEXPROCESSING;
}
else
{
vp=D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
//创建Direct3D设备接口
D3DPRESENT_PARAMETERS d3dpp;
d3dpp.AutoDepthStencilFormat=D3DFMT_D24S8;
d3dpp.BackBufferCount=1;
d3dpp.BackBufferFormat=D3DFMT_A8R8G8B8;
d3dpp.BackBufferHeight=640;
d3dpp.BackBufferWidth=480;
d3dpp.EnableAutoDepthStencil=FALSE;
d3dpp.Flags=0;
d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_DEFAULT;
d3dpp.hDeviceWindow=hwnd;
d3dpp.MultiSampleQuality=0;
d3dpp.MultiSampleType=D3DMULTISAMPLE_NONE;
d3dpp.PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;
d3dpp.Windowed=TRUE;
if (FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hwnd,D3DCREATE_HARDWARE_VERTEXPROCESSING,&d3dpp,&g_pd3dDevice)))
{
return E_FAIL;
}
D3DXCreateTeapot(g_pd3dDevice,&g_pMeshTeapot,0); //创建茶壶集合体
//创建DirectInput设备
DirectInput8Create(hinstance,0x0800,IID_IDirectInput8,(void **)&g_pDirectInput,NULL);
//创建键盘设备
g_pDirectInput->CreateDevice(GUID_SysMouse,&g_pMouseDevice,NULL);
//设置数据格式和协作级别
g_pMouseDevice->SetDataFormat(&c_dfDIMouse);
g_pMouseDevice->SetCooperativeLevel(hwnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
//获取设备
g_pMouseDevice->Acquire();
////世界变换矩阵
//D3DXMATRIX matWorld,Rx,Ry,Rz;
//D3DXMatrixIdentity(&matWorld);
//D3DXMatrixRotationX(&Rx,/*::timeGetTime()/1000*/1.0f);
//D3DXMatrixRotationY(&Ry,/*::timeGetTime()/1000*//*1.0f*/::timeGetTime()/1000.0f);
//D3DXMatrixRotationZ(&Rz,/*::timeGetTime()/1000.0f*//*::timeGetTime()/1000*/1.0f);
//matWorld=Rx*Ry*Rz*matWorld;
//g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//取景变换矩阵
D3DXMATRIX matView;
D3DXVECTOR3 vEye(0.0f,0.0f,-10.0f);
D3DXVECTOR3 vAt(0.0f,0.0f,0.0f);
D3DXVECTOR3 vUp(0.0f,1.0f,0.0f);
D3DXMatrixLookAtLH(&matView,&vEye,&vAt,&vUp);
g_pd3dDevice->SetTransform(D3DTS_VIEW,&matView);
//投影变换矩阵
D3DXMATRIX matProj;
D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4.0f,1.0f,1.0f,1000.0f);
g_pd3dDevice->SetTransform(D3DTS_PROJECTION,&matProj);
pD3D->Release();
return S_OK;
}
//渲染图形
VOID Render()
{
g_pd3dDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(150,150,255),1.0f,0); //清除后台缓冲区
g_pd3dDevice->BeginScene(); //开始绘制
::ZeroMemory(&g_diMousestate,sizeof(g_pMouseDevice));
ReadDevice(g_pMouseDevice,(LPVOID)&g_diMousestate,sizeof(g_diMousestate));
////鼠标左键平移物体
static FLOAT fPosX=0.0f,fPosY=0.0f,fPosZ=0.0f;
if (g_diMousestate.rgbButtons[0]&0x80)
{
fPosX+=g_diMousestate.lX*0.01f; //沿X轴平移
fPosY+=g_diMousestate.lY*-0.01f; //沿Y轴平移
}
fPosZ+=g_diMousestate.lZ*0.005f;
D3DXMATRIX matWorld;
D3DXMatrixTranslation(&matWorld,fPosX,fPosY,fPosZ);
//鼠标右键旋转物体
static float fAngleX=0.0f,fAngleY=0.0f;
if (g_diMousestate.rgbButtons[1]&0x80)
{
fAngleX+=g_diMousestate.lX*-0.01f;
fAngleY+=g_diMousestate.lY*-0.01f;
}
D3DXMATRIX Rx,Ry;
D3DXMatrixRotationX(&Rx,fAngleX);
D3DXMatrixRotationY(&Ry,fAngleY);
matWorld=Rx*Ry*matWorld;
g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//绘制茶壶
g_pMeshTeapot->DrawSubset(0);
g_pd3dDevice->EndScene(); //结束绘制
g_pd3dDevice->Present(NULL,NULL,NULL,NULL); //从后台缓冲区复制到前台----翻转
}
//清除对象,内存
VOID Cleanup()
{
g_pMouseDevice->Unacquire();
ReleaseD3D(g_pMeshTeapot);
ReleaseD3D(g_pMouseDevice);
ReleaseD3D(g_pDirectInput);
ReleaseD3D(g_pd3dDevice);
//if (g_pMeshTeapot!=NULL)
//{
// g_pMeshTeapot->Release();
// g_pMeshTeapot=NULL;
//}
//if (g_pKeyboardDevice!=NULL)
//{
// g_pKeyboardDevice->Release();
// g_pKeyboardDevice=NULL;
//}
//if (g_pDirectInput!=NULL)
//{
// g_pDirectInput->Release();
// g_pDirectInput=NULL;
//}
//if (g_pd3dDevice!=NULL)
//{
// g_pd3dDevice->Release();
// g_pd3dDevice=NULL;
//}
}
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize)
{
HRESULT hr;
while(true)
{
/*pDIDevice->Poll();*/
pDIDevice->Acquire();
if (SUCCEEDED(hr=pDIDevice->GetDeviceState(ISize,pBuffer))) break;
if (hr!=DIERR_INPUTLOST||hr!=DIERR_NOTACQUIRED) return FALSE;
/*if (FAILED(pDIDevice->Acquire())) return FALSE */;
}
return TRUE;
}
代码实例2:
// @time: 2012.3.26
// @author: jadeshu
// des: DirectX鼠标控制程序
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <atlstr.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#define ReleaseD3D(x) if (x!=NULL){x->Release();x=NULL;}
#pragma comment(lib,"winmm.lib")
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dinput8.lib")
#pragma comment(lib, "dxguid.lib")
//全局变量
TCHAR g_szWindowName[]=_T("DirectX鼠标控制程序");
BOOL bActive = TRUE;
DIMOUSESTATE g_diMousestate={0};
//定义设备接口
IDirect3DDevice9 * g_pd3dDevice=NULL;
LPDIRECTINPUT8 g_pDirectInput=NULL; //DirectInput接口
LPDIRECTINPUTDEVICE8 g_pMouseDevice=NULL; //键盘输入接口
LPD3DXMESH g_pMeshTeapot=NULL; //茶壶网格对象
//回调函数声明
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
//初始化Direct3D函数声明
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance);
//渲染声明
VOID Render();
//清除对象声明
VOID Cleanup();
//读取设备的输入数据
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize);
//主函数
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
//定义窗口类结构
TCHAR szAppName[]=TEXT("ClassN");
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
ZeroMemory(&msg,sizeof(msg));
wc.cbClsExtra=0;
wc.cbSize=sizeof(WNDCLASSEX);
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hCursor=LoadCursor(hInstance,IDC_ARROW);
wc.hIcon=LoadIcon(hInstance,IDI_APPLICATION);
wc.hIconSm=NULL;
wc.hInstance=hInstance;
wc.lpfnWndProc=WinProc;
wc.lpszClassName=szAppName;
wc.lpszMenuName=NULL;
wc.style=CS_HREDRAW|CS_VREDRAW;
//注册窗口
RegisterClassEx(&wc);
//创建窗口
hwnd=CreateWindow(szAppName,g_szWindowName,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,0);
//加载3D初始化
if (FAILED(Init3D(hwnd,hInstance)))
{
return FALSE;
}
//显示和更新窗口
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
//消息循环
while (WM_QUIT!=msg.message)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
//转换消息
TranslateMessage(&msg);
//投递消息
DispatchMessage(&msg);
}
else if(bActive)
{
//渲染
Render();
}
else
{
if(!WaitMessage())
return -1;
}
}
//删除注册窗口
UnregisterClass(szAppName,hInstance);
return msg.wParam;
}
//回调函数
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch (uMsg)
{
case WM_PAINT:
Render(); //渲染
ValidateRect(hwnd,NULL); //更新窗口
return 0;
case WM_ACTIVATEAPP:
bActive = (BOOL)wParam;
break;
case WM_DESTROY:
Cleanup(); //清除对象
PostQuitMessage(0); //退出消息循环
return 0;
}
return DefWindowProc(hwnd,uMsg,wParam,lParam); //返回默认消息
}
//Direct3D初始化
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance)
{
IDirect3D9 *pD3D=NULL; //定义对象接口
pD3D=Direct3DCreate9(D3D_SDK_VERSION); //创建对象接口
if (NULL==pD3D)
{
return E_FAIL;
}
D3DCAPS9 caps; //获取硬件设备信息
int vp=0;
pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
if (caps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT)
{
vp=D3DCREATE_HARDWARE_VERTEXPROCESSING;
}
else
{
vp=D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
//创建Direct3D设备接口
D3DPRESENT_PARAMETERS d3dpp;
d3dpp.AutoDepthStencilFormat=D3DFMT_D24S8;
d3dpp.BackBufferCount=1;
d3dpp.BackBufferFormat=D3DFMT_A8R8G8B8;
d3dpp.BackBufferHeight=640;
d3dpp.BackBufferWidth=480;
d3dpp.EnableAutoDepthStencil=FALSE;
d3dpp.Flags=0;
d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_DEFAULT;
d3dpp.hDeviceWindow=hwnd;
d3dpp.MultiSampleQuality=0;
d3dpp.MultiSampleType=D3DMULTISAMPLE_NONE;
d3dpp.PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;
d3dpp.Windowed=TRUE;
if (FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hwnd,D3DCREATE_HARDWARE_VERTEXPROCESSING,&d3dpp,&g_pd3dDevice)))
{
return E_FAIL;
}
D3DXCreateTeapot(g_pd3dDevice,&g_pMeshTeapot,0); //创建茶壶集合体
//创建DirectInput设备
DirectInput8Create(hinstance,0x0800,IID_IDirectInput8,(void **)&g_pDirectInput,NULL);
//创建键盘设备
g_pDirectInput->CreateDevice(GUID_SysMouse,&g_pMouseDevice,NULL);
//设置数据格式和协作级别
g_pMouseDevice->SetDataFormat(&c_dfDIMouse);
g_pMouseDevice->SetCooperativeLevel(hwnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
//获取设备
g_pMouseDevice->Acquire();
////世界变换矩阵
//D3DXMATRIX matWorld,Rx,Ry,Rz;
//D3DXMatrixIdentity(&matWorld);
//D3DXMatrixRotationX(&Rx,/*::timeGetTime()/1000*/1.0f);
//D3DXMatrixRotationY(&Ry,/*::timeGetTime()/1000*//*1.0f*/::timeGetTime()/1000.0f);
//D3DXMatrixRotationZ(&Rz,/*::timeGetTime()/1000.0f*//*::timeGetTime()/1000*/1.0f);
//matWorld=Rx*Ry*Rz*matWorld;
//g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//取景变换矩阵
D3DXMATRIX matView;
D3DXVECTOR3 vEye(0.0f,0.0f,-10.0f);
D3DXVECTOR3 vAt(0.0f,0.0f,0.0f);
D3DXVECTOR3 vUp(0.0f,1.0f,0.0f);
D3DXMatrixLookAtLH(&matView,&vEye,&vAt,&vUp);
g_pd3dDevice->SetTransform(D3DTS_VIEW,&matView);
//投影变换矩阵
D3DXMATRIX matProj;
D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4.0f,1.0f,1.0f,1000.0f);
g_pd3dDevice->SetTransform(D3DTS_PROJECTION,&matProj);
pD3D->Release();
return S_OK;
}
//渲染图形
VOID Render()
{
g_pd3dDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(150,150,255),1.0f,0); //清除后台缓冲区
g_pd3dDevice->BeginScene(); //开始绘制
::ZeroMemory(&g_diMousestate,sizeof(g_pMouseDevice));
ReadDevice(g_pMouseDevice,(LPVOID)&g_diMousestate,sizeof(g_diMousestate));
////鼠标左键平移物体
static FLOAT fPosX=0.0f,fPosY=0.0f,fPosZ=0.0f;
if (g_diMousestate.rgbButtons[0]&0x80)
{
fPosX+=g_diMousestate.lX*0.01f; //沿X轴平移
fPosY+=g_diMousestate.lY*-0.01f; //沿Y轴平移
}
fPosZ+=g_diMousestate.lZ*0.005f;
D3DXMATRIX matWorld;
D3DXMatrixTranslation(&matWorld,fPosX,fPosY,fPosZ);
//鼠标右键旋转物体
static float fAngleX=0.0f,fAngleY=0.0f;
if (g_diMousestate.rgbButtons[1]&0x80)
{
fAngleX+=g_diMousestate.lX*-0.01f;
fAngleY+=g_diMousestate.lY*-0.01f;
}
D3DXMATRIX Rx,Ry;
D3DXMatrixRotationX(&Rx,fAngleX);
D3DXMatrixRotationY(&Ry,fAngleY);
matWorld=Rx*Ry*matWorld;
g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//绘制茶壶
g_pMeshTeapot->DrawSubset(0);
g_pd3dDevice->EndScene(); //结束绘制
g_pd3dDevice->Present(NULL,NULL,NULL,NULL); //从后台缓冲区复制到前台----翻转
}
//清除对象,内存
VOID Cleanup()
{
g_pMouseDevice->Unacquire();
ReleaseD3D(g_pMeshTeapot);
ReleaseD3D(g_pMouseDevice);
ReleaseD3D(g_pDirectInput);
ReleaseD3D(g_pd3dDevice);
//if (g_pMeshTeapot!=NULL)
//{
// g_pMeshTeapot->Release();
// g_pMeshTeapot=NULL;
//}
//if (g_pKeyboardDevice!=NULL)
//{
// g_pKeyboardDevice->Release();
// g_pKeyboardDevice=NULL;
//}
//if (g_pDirectInput!=NULL)
//{
// g_pDirectInput->Release();
// g_pDirectInput=NULL;
//}
//if (g_pd3dDevice!=NULL)
//{
// g_pd3dDevice->Release();
// g_pd3dDevice=NULL;
//}
}
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize)
{
HRESULT hr;
while(true)
{
/*pDIDevice->Poll();*/
pDIDevice->Acquire();
if (SUCCEEDED(hr=pDIDevice->GetDeviceState(ISize,pBuffer))) break;
if (hr!=DIERR_INPUTLOST||hr!=DIERR_NOTACQUIRED) return FALSE;
/*if (FAILED(pDIDevice->Acquire())) return FALSE */;
}
return TRUE;
}
DX9 DirectX鼠标控制程序 代码的更多相关文章
- DX9 DirectX键盘控制程序 代码
// @time: 2012.3.26 // @author: jadeshu // des: DirectX键盘控制程序 #include <Windows.h> #include &l ...
- DX9 DirectX 索引缓存(IndexBuffer) 代码
// @time: 2012.3.22 // @author: jadeshu // des: 索引缓存 //包含头文件 #include <Windows.h> #include < ...
- js模拟下拉菜单-键盘、鼠标(代码详解)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- DX9 空间坐标变换示例代码
// @time 2012.3.25 // @author jadeshu #include <Windows.h> #include <d3d9.h> #include &l ...
- 免费CSS鼠标样式代码大全
原文发布时间为:2008-08-01 -- 来源于本人的百度文章 [由搬家工具导入] http://5211.91.tc/sb.htm
- 使用C#+FFmpeg+DirectX+dxva2硬件解码播放h264流
本文门槛较高,因此行文看起来会乱一些,如果你看到某处能会心一笑请马上联系我开始摆龙门阵 如果你跟随这篇文章实现了播放器,那你会得到一个高效率,低cpu占用(单路720p视频解码播放占用1%左右cpu) ...
- 博客代码:iframe—网页中嵌入其他网页
iframe 是一个可以把另外一个网页嵌入到一个网页里的代码,非常有用.对于一个内容不错的网页,要方便地把它搬到自己的博客里,用这个代码最合适.而对于在新浪博客里不支持的一些网页效果和代码,可先把他们 ...
- JS禁止WEB页面鼠标事件大全
<!--禁止鼠标右键代码-->:<noscript><ifra:<scriptlanguage=javas:<!--:if(window.Event):doc ...
- 代码自动生成工具MyGeneration之一(程序员必备工具)
代码自动生成工具MyGeneration之一(程序员必备工具) 转 分类: C#2008-08-06 18:12 16064人阅读 评论(12) 收藏 举报 工具数据库相关数据库stringbrows ...
随机推荐
- delphi传递变量给fastreport
delphi传递变量给fastreport 1.打开frReport报表设计.2.打开file->data dictionary加变量.这里比如加title,bm,zbr,gj,zrs3.在 ...
- 转:ArcGIS API for JavaScript之图层
参考文章地址: https://developers.arcgis.com/javascript/3/jsapi/layer-amd.html Layer |–TiledMapServiceLayer ...
- 洛谷P2303 [SDOi2012] Longge的问题 数论
看懂了题解,太妙了TT但是想解释的话可能要很多数学公式打起来太麻烦了TT所以我就先只放代码具体推演的过程我先写在纸上然后拍下来做成图片放上来算辣quq 好的那我先滚去做题了做完这题就把题解放上来.因为 ...
- 使用jquery.uploadify上传文件
今天在网上找了一天,想要找到一个比较全的使用案例,结果发现基本上全是一个版本的... 我的问题主要是上传完成后,还需要将路径获取到,然后保存到数据库. 查了一下资料发现有这么一个参数onComplet ...
- 并查集——易爆物D305
部分内容摘自博客http://blog.csdn.net/u012881011/article/details/46883863,感谢 易爆物D305 运行时间限制:1000m ...
- Log4j与Logback
一.Log4j简介: 1.Log4j(log for java) 01.是apache的一个开源项目 02.是使用java语言编写的一个日志框架 03.用于记录程序中的日志信息 04.可以将日志信息输 ...
- wordpress去掉category怎么操作让url更简洁友好
用wordpress建站是比较流行的,全球将近25%的站点是用wordpress搭建的.有很多的模板.插件可以选择,当然最好还是能自己优化.URL固定链接就是之中一个基础的技巧.有网友问如何去掉url ...
- zookeeper(百度百科http://baike.baidu.com/view/3061646.htm?fr=aladdin)
ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护.名字服务.分布式同步.组服务等.ZooKeeper的目标就是封装好复杂易出错的关键服务 ...
- Spark创建空的DataFrame
前言 本文主要给出Spark创建空的DataFrame的代码示例,这里讲的空的DataFrame主要指有列名(可以自己随意指定),但是没有行的DataFrame,因为自己在开发过程中有这个需求,之前并 ...
- (转)MySQL排序原理与案例分析
前言 排序是数据库中的一个基本功能,MySQL也不例外.用户通过Order by语句即能达到将指定的结果集排序的目的,其实不仅仅是Order by语句,Group by语句,Distinct ...