技术标签: direct3d filter border Direct 3d游戏编程 textures function buffer
Creates a texture from a file.
HRESULT D3DXCreateTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, LPDIRECT3DTEXTURE9 * ppTexture );
If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following:
D3DERR_NOTAVAILABLED3DERR_OUTOFVIDEOMEMORYD3DERR_INVALIDCALLD3DXERR_INVALIDDATAE_OUTOFMEMORYThe compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXCreateTextureFromFileW. Otherwise, the function call resolves to D3DXCreateTextureFromFileA because ANSI strings are being used.
This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See D3DXIMAGE_FILEFORMAT.
The function is equivalent to D3DXCreateTextureFromFileEx(pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, ppTexture).
Mipmapped textures automatically have each level filled with the loaded texture.
When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, the images need to be loaded manually.
Note that a resource created with this function will be placed in the memory class denoted by D3DPOOL_MANAGED.
Filtering is automatically applied to a texture created using this method. The filtering is equivalent to D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER in D3DX_FILTER.
For the best performance when using D3DXCreateTextureFromFile:
可以使用更高级的函数D3DXCreateTextureFromFileEx来创建纹理对象。
Creates a texture from a file. This is a more advanced function than D3DXCreateTextureFromFile.
HRESULT D3DXCreateTextureFromFileEx(
LPDIRECT3DDEVICE9 pDevice,
LPCTSTR pSrcFile,
UINT Width,
UINT Height,
UINT MipLevels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
DWORD Filter,
DWORD MipFilter,
D3DCOLOR ColorKey,
D3DXIMAGE_INFO * pSrcInfo,
PALETTEENTRY * pPalette,
LPDIRECT3DTEXTURE9 * ppTexture
);
Parameters
If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL.
D3DERR_NOTAVAILABLED3DERR_OUTOFVIDEOMEMORYD3DXERR_INVALIDDATAE_OUTOFMEMORYThe compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXCreateTextureFromFileExW. Otherwise, the function call resolves to D3DXCreateTextureFromFileExA because ANSI strings are being used.
Use D3DXCheckTextureRequirements to determine if your device can support the texture given the current state.
This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See D3DXIMAGE_FILEFORMAT.
Mipmapped textures automatically have each level filled with the loaded texture. When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.
For the best performance when using D3DXCreateTextureFromFileEx:
When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.
当然也可以通过IDirect3DDevice9::CreateTexture来创建一个纹理对象。
Creates a texture resource.
HRESULT CreateTexture( UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle );
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.
An application can discover support for Automatic Generation of Mipmaps (Direct3D 9) in a particular format by calling IDirect3D9::CheckDeviceFormat with D3DUSAGE_AUTOGENMIPMAP. If IDirect3D9::CheckDeviceFormat returns D3DOK_NOAUTOGEN, IDirect3DDevice9::CreateTexture will succeed but it will return a one-level texture.
通过IDirect3DTexture9::LockRect创建完IDirect3DTexture9对象后,可以通过IDirect3DTexture9::LockRect获得纹理数据。
Locks a rectangle on a texture resource.
HRESULT LockRect( UINT Level, D3DLOCKED_RECT * pLockedRect, CONST RECT * pRect, DWORD Flags );
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
Textures created with D3DPOOL_DEFAULT are not lockable. Textures created in video memory are lockable when created with USAGE_DYNAMIC.
For performance reasons, dirty regions are recorded only for level zero of a texture. Dirty regions are automatically recorded when IDirect3DTexture9::LockRect is called without D3DLOCK_NO_DIRTY_UPDATE or D3DLOCK_READONLY. See IDirect3DDevice9::UpdateTexture for more information.
The only lockable format for a depth-stencil texture is D3DLOCK_D16_LOCKABLE.
Video memory textures cannot be locked, but must be modified by calling IDirect3DDevice9::UpdateSurface or IDirect3DDevice9::UpdateTexture. There are exceptions for some proprietary driver pixel formats that Direct3D 9 does not recognize. These can be locked.
This method cannot retrieve data from a texture resource created with D3DUSAGE_RENDERTARGET because such a texture must be assigned to D3DPOOL_DEFAULT memory and is therefore not lockable. In this case, use instead IDirect3DDevice9::GetRenderTargetData to copy texture data from device memory to system memory.
锁定之后,必须通过IDirect3DTexture9::UnlockRect来对IDirect3DTexture9对象进行解锁。
Unlocks a rectangle on a texture resource.
HRESULT UnlockRect( UINT Level );
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
利用IDirect3DDevice9接口提供的SetTexture函数进行纹理设置,由于可进行多次纹理蒙皮,将纹理对象设置给固定渲染管道流水线时,必须提供所在的采样器序号或纹理状态序号,以区别不同的纹理处理。
Sets a texture.
HRESULT SetTexture( D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture );
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
可以通过GetLevelDesc来获取特定采样级别的纹理表面描述信息:
Retrieves a level description of a texture resource.
HRESULT GetLevelDesc( UINT Level, D3DSURFACE_DESC * pDesc );
If the method succeeds, the return value is D3D_OK. D3DERR_INVALIDCALL is returned if one of the arguments is invalid.
pDesc为一个指向D3DSURFACE_DESC数据类型的指针,来看看它的具体定义:
Describes a surface.
typedef struct D3DSURFACE_DESC { D3DFORMAT Format; D3DRESOURCETYPE Type; DWORD Usage; D3DPOOL Pool; D3DMULTISAMPLE_TYPE MultiSampleType; DWORD MultiSampleQuality; UINT Width; UINT Height; } D3DSURFACE_DESC, *LPD3DSURFACE_DESC;
Defines resource types.
typedef enum D3DRESOURCETYPE { D3DRTYPE_SURFACE = 1, D3DRTYPE_VOLUME = 2, D3DRTYPE_TEXTURE = 3, D3DRTYPE_VOLUMETEXTURE = 4, D3DRTYPE_CubeTexture = 5, D3DRTYPE_VERTEXBUFFER = 6, D3DRTYPE_INDEXBUFFER = 7, D3DRTYPE_FORCE_DWORD = 0x7fffffff, } D3DRESOURCETYPE, *LPD3DRESOURCETYPE;
Sets the sampler state value.
HRESULT SetSamplerState( DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value );
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
来看看D3DSAMPLERSTATETYPE的具体定义:
Sampler states define texture sampling operations such as texture addressing and texture filtering. Some sampler states set-up vertex processing, and some set-up pixel processing. Sampler states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).
typedef enum D3DSAMPLERSTATETYPE { D3DSAMP_ADDRESSU = 1, D3DSAMP_ADDRESSV = 2, D3DSAMP_ADDRESSW = 3, D3DSAMP_BORDERCOLOR = 4, D3DSAMP_MAGFILTER = 5, D3DSAMP_MINFILTER = 6, D3DSAMP_MIPFILTER = 7, D3DSAMP_MIPMAPLODBIAS = 8, D3DSAMP_MAXMIPLEVEL = 9, D3DSAMP_MAXANISOTROPY = 10, D3DSAMP_SRGBTEXTURE = 11, D3DSAMP_ELEMENTINDEX = 12, D3DSAMP_DMAPOFFSET = 13, D3DSAMP_FORCE_DWORD = 0x7fffffff, } D3DSAMPLERSTATETYPE, *LPD3DSAMPLERSTATETYPE;
对于过滤技术来说,Type参数可取值D3DSAMP_MIPFILTER,D3DSAMP_MAGFILTER和 D3DSAMP_MINFILTER,而Value参数可取如下类型的枚举值。
Defines texture filtering modes for a texture stage.
typedef enum D3DTEXTUREFILTERTYPE { D3DTEXF_NONE = 0, D3DTEXF_POINT = 1, D3DTEXF_LINEAR = 2, D3DTEXF_ANISOTROPIC = 3, D3DTEXF_PYRAMIDALQUAD = 6, D3DTEXF_GAUSSIANQUAD = 7, D3DTEXF_FORCE_DWORD = 0x7fffffff, } D3DTEXTUREFILTERTYPE, *LPD3DTEXTUREFILTERTYPE;
To check if a format supports texture filter types other than D3DTEXF_POINT (which is always supported), call IDirect3D9::CheckDeviceFormat with D3DUSAGE_QUERY_FILTER.
Set a texture stage's magnification filter by calling IDirect3DDevice9::SetSamplerState with the D3DSAMP_MAGFILTER value as the second parameter and one member of this enumeration as the third parameter.
Set a texture stage's minification filter by calling IDirect3DDevice9::SetSamplerState with the D3DSAMP_MINFILTER value as the second parameter and one member of this enumeration as the third parameter.
Set the texture filter to use between-mipmap levels by calling IDirect3DDevice9::SetSamplerState with the D3DSAMP_MIPFILTER value as the second parameter and one member of this enumeration as the third parameter.
Not all valid filtering modes for a device will apply to volume maps. In general, D3DTEXF_POINT and D3DTEXF_LINEAR magnification filters will be supported for volume maps. If D3DPTEXTURECAPS_MIPVOLUMEMAP is set, then the D3DTEXF_POINT mipmap filter and D3DTEXF_POINT and D3DTEXF_LINEAR minification filters will be supported for volume maps. The device may or may not support the D3DTEXF_LINEAR mipmap filter for volume maps. Devices that support anisotropic filtering for 2D maps do not necessarily support anisotropic filtering for volume maps. However, applications that enable anisotropic filtering will receive the best available filtering (probably linear) if anisotropic filtering is not supported.
纹理地址模式
纹理源图像的像素点都用纹理坐标系的[0, 1] x [0, 1]范围内的坐标来量度,如果选定的顶点纹理坐标u和v大于1或小于0时,那么对应的纹理像素点在纹理源图上是不存在的。因此需要用相应的纹理地址模式来寻址,确定该顶点颜色值应该采用的纹理像素颜色值。由此可见,当选定的待渲染三角形面顶点的纹理坐标超出[0, 1]区间时,可获得一些特别的渲染效果。
纹理地址模式具有包装模式(Wrap),镜像模式(Mirror),夹子模式(Clamp),边界模式(Border)和一次镜像模式(MirrorOnce)等多种寻址控制方式,来看看这些模式的枚举定义:
Defines constants that describe the supported texture-addressing modes.
typedef enum D3DTEXTUREADDRESS { D3DTADDRESS_WRAP = 1, D3DTADDRESS_MIRROR = 2, D3DTADDRESS_CLAMP = 3, D3DTADDRESS_BORDER = 4, D3DTADDRESS_MIRRORONCE = 5, D3DTADDRESS_FORCE_DWORD = 0x7fffffff, } D3DTEXTUREADDRESS, *LPD3DTEXTUREADDRESS;
头文件使用结构体CUSTOM_VERTEX定义了一个正方形的顶点格式,包括顶点坐标和顶点纹理坐标,Set_Texture_Address_Mode函数用来设置纹理地址模式,Render函数将使用三角形带方式进行渲染,并将纹理对象贴在正方形面上。
来看看TextureAddress.cpp的实现:
/************************************************************************************* [Implement File] PURPOSE: Define for texture mapped. *************************************************************************************/ #include "GE_COMMON.h" #include "TextureAddress.h" //------------------------------------------------------------------------------------ // Constructor, initialize all pointer with NULL. //------------------------------------------------------------------------------------ TEXTURE_ADDRESS::TEXTURE_ADDRESS() { _d3d = NULL; _d3d_device = NULL; _vertex_buffer = NULL; _d3d_texture = NULL; } //------------------------------------------------------------------------------------ // Destructor, release resource allocated for Direct3D. //------------------------------------------------------------------------------------ TEXTURE_ADDRESS::~TEXTURE_ADDRESS() { Release_Direct3D(); } //------------------------------------------------------------------------------------ // Create direct3D interface and direct3D device. //------------------------------------------------------------------------------------ bool TEXTURE_ADDRESS::Create_D3D_Device(HWND hwnd, bool full_screen) { // Create a IDirect3D9 object and returns an interace to it. _d3d = Direct3DCreate9(D3D_SDK_VERSION); if(_d3d == NULL) return false; // retrieve adapter capability D3DCAPS9 d3d_caps; _d3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3d_caps); bool hardware_process_enable = (d3d_caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? true : false); // Retrieves the current display mode of the adapter. D3DDISPLAYMODE display_mode; if(FAILED(_d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &display_mode))) return false; // set present parameter for direct3D device D3DPRESENT_PARAMETERS present_param = {0}; present_param.BackBufferWidth = WINDOW_WIDTH; present_param.BackBufferHeight = WINDOW_HEIGHT; present_param.BackBufferFormat = display_mode.Format; present_param.BackBufferCount = 1; present_param.hDeviceWindow = hwnd; present_param.Windowed = !full_screen; present_param.SwapEffect = D3DSWAPEFFECT_FLIP; present_param.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; // Creates a device to represent the display adapter. DWORD behavior_flags; behavior_flags = hardware_process_enable ? D3DCREATE_HARDWARE_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING; if(FAILED(_d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, behavior_flags, &present_param, &_d3d_device))) { return false; } // create successfully return true; } //------------------------------------------------------------------------------------ // Initialize vertex buffer. //------------------------------------------------------------------------------------ bool TEXTURE_ADDRESS::Init_Vertex_Buffer() { CUSTOM_VERTEX custom_vertex[] = { {100.0f, 100.0f, 0.0f, 1.0f, 0.0f, 0.0f}, {380.0f, 100.0f, 0.0f, 1.0f, 3.0f, 0.0f}, {100.0f, 380.0f, 0.0f, 1.0f, 0.0f, 3.0f}, {380.0f, 380.0f, 0.0f, 1.0f, 3.0f, 3.0f} }; BYTE* vertex_data; // create vertex buffer if(FAILED(_d3d_device->CreateVertexBuffer(4 * sizeof(CUSTOM_VERTEX), 0, CUSTOM_VERTEX_FVF, D3DPOOL_MANAGED, &_vertex_buffer, NULL))) { return false; } // get data pointer to vertex buffer if(FAILED(_vertex_buffer->Lock(0, 0, (void **) &vertex_data, 0))) return false; // copy custom vertex data into vertex buffer memcpy(vertex_data, custom_vertex, sizeof(custom_vertex)); // unlock vertex buffer _vertex_buffer->Unlock(); return true; } //------------------------------------------------------------------------------------ // Sets the sampler state value. //------------------------------------------------------------------------------------ void TEXTURE_ADDRESS::Set_Texture_Address_Mode(int mode) { switch(mode) { case D3DTADDRESS_WRAP: _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); break; case D3DTADDRESS_MIRROR: _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_MIRROR); _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_MIRROR); break; case D3DTADDRESS_CLAMP: _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); break; case D3DTADDRESS_BORDER: _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER); _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER); break; case D3DTADDRESS_MIRRORONCE: _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_MIRRORONCE); _d3d_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_MIRRORONCE); break; } } //------------------------------------------------------------------------------------ // Render object. //------------------------------------------------------------------------------------ void TEXTURE_ADDRESS::Render() { if(_d3d_device == NULL) return; // clear surface with color white _d3d_device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 255, 255), 1.0, 0); // begin scene _d3d_device->BeginScene(); // Binds a vertex buffer to a device data stream. _d3d_device->SetStreamSource(0, _vertex_buffer, 0, sizeof(CUSTOM_VERTEX)); // Sets the current vertex stream declaration. _d3d_device->SetFVF(CUSTOM_VERTEX_FVF); // Creates a texture from a file. if(FAILED(D3DXCreateTextureFromFile(_d3d_device, _T("tiger.jpg"), &_d3d_texture))) { MessageBox(NULL, "Create texture interface failed.", "ERROR", MB_OK); return; } // Assigns a texture to a stage for a device. _d3d_device->SetTexture(0, _d3d_texture); // Renders a sequence of nonindexed, geometric primitives of the specified type from the current // set of data input streams. _d3d_device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); // end scene _d3d_device->EndScene(); // Presents the contents of the next buffer in the sequence of back buffers owned by the device. _d3d_device->Present(NULL, NULL, NULL, NULL); } //------------------------------------------------------------------------------------ // Release resource allocated for Direct3D. //------------------------------------------------------------------------------------ void TEXTURE_ADDRESS::Release_Direct3D() { Safe_Release(_d3d_texture); Safe_Release(_vertex_buffer); Safe_Release(_d3d_device); Safe_Release(_d3d); }
再来看看测试代码:
/************************************************************************************* [Implement File] PURPOSE: Test for texture render. *************************************************************************************/ #define DIRECTINPUT_VERSION 0x0800 #include "GE_APP.h" #include "GE_INPUT.h" #include "TextureAddress.h" #pragma warning(disable : 4305 4996) int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR cmd_line, int cmd_show) { GE_APP ge_app; GE_INPUT ge_input; TEXTURE_ADDRESS texture_address; MSG msg = {0}; // create window if(! ge_app.Create_Window("Material and light test", instance, cmd_show)) return false; HWND hwnd = ge_app.Get_Window_Handle(); HDC hdc = GetDC(hwnd); // create directinput ge_input.Create_Input(instance, hwnd); SetWindowPos(hwnd, 0, 0,0,0,0, SWP_NOSIZE); SetCursorPos(0, 0); // Create direct3D interface and direct3D device. if(! texture_address.Create_D3D_Device(hwnd, false)) return false; // Initialize vertex buffer with curstom vertex structure. if(! texture_address.Init_Vertex_Buffer()) return false; while(msg.message != WM_QUIT) { if(PeekMessage(&msg, NULL, 0,0 , PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } else { // read data from keyboard buffer if(ge_input.Read_Keyboard()) { bool key_w_pressed = ge_input.Is_Key_Pressed(DIK_W); bool key_m_pressed = ge_input.Is_Key_Pressed(DIK_M); bool key_c_pressed = ge_input.Is_Key_Pressed(DIK_C); bool key_b_pressed = ge_input.Is_Key_Pressed(DIK_B); bool key_o_pressed = ge_input.Is_Key_Pressed(DIK_O); const char* text = NULL; // set texture address mode if(key_w_pressed || key_m_pressed || key_c_pressed || key_b_pressed || key_o_pressed) { if(key_w_pressed) { texture_address.Set_Texture_Address_Mode(D3DTADDRESS_WRAP); text = "wrap mode"; } if(key_m_pressed) { texture_address.Set_Texture_Address_Mode(D3DTADDRESS_MIRROR); text = "morror mode"; } if(key_c_pressed) { texture_address.Set_Texture_Address_Mode(D3DTADDRESS_CLAMP); text = "clamp mode"; } if(key_b_pressed) { texture_address.Set_Texture_Address_Mode(D3DTADDRESS_BORDER); text = "address border mode"; } if(key_o_pressed) { texture_address.Set_Texture_Address_Mode(D3DTADDRESS_MIRRORONCE); text = "address mirror once mode"; } // render object texture_address.Render(); // print hint information TextOut(hdc, WINDOW_WIDTH - 200, WINDOW_HEIGHT - 100, text, (int) strlen(text)); } // press "ESC", close window. if(ge_input.Is_Key_Pressed(DIK_ESCAPE)) PostQuitMessage(0); } } } UnregisterClass(WINDOW_CLASS_NAME, instance); return true; }
按下W键将启用包裹(Wrap)模式,按下M键将启用镜像(Mirror)模式,按下C键将启用夹子(Clamp)模式,按下B键将启用边界(Border)模式,按下O键将启用一次镜像(MirrorOnce)模式。 运行效果: 包裹模式 镜像模式 夹子模式 边界模式 一次镜像模式
文章浏览阅读408次。 在ubuntu 8.04下安装Oracle 11g2008年05月22日 星期四 11:02oracle 11g 数据库虽然提供了linux x86的版本,但是支持的linux版本只有Red Hat,Novell and Solaris 这几个,debian 和 ubuntu 不在支持之列,所以在ubuntu下安装就相对麻烦一些,请照着下文的方法一步一步的安装,不
文章浏览阅读166次。新东方在线中考网整理了《初一英语下册语法知识点全汇总》,供同学们参考。一. 情态动词can的用法can+动词原形,它不随主语的人称和数而变化。1. 含有can的肯定句:主语+can+谓语动词的原形+其他。2. 含有can的否定句:主语+can't+动词的原形+其他。3. 变一般疑问句时,把can提前:Can+主语+动词原形+其他? 肯定回答:Yes,主语+can。否定回答:No,主语+can't...._七年级下册计算机知识点
文章浏览阅读3k次。在平时开发中,可能会遇到UFUN函数没有的功能,比如创建PTP的加工程序(我目前没找到,哪位大神可以指点一下),可以使用Grip创建PTP,然后用UFUN函数UF_call_grip调用Grip程序。具体如下截图(左侧UFUN,右侧Grip程序):..._uf调用grip
文章浏览阅读156次。第一个:原生普通样式(随着主题不同,样式会变)第二个:原生普通样式-小icon第三个:自定义RatingBar 颜色第四个:自定义RatingBar DrawableRatingBar 各样式实现===============原生样式原生样式其实没什么好说的,使用系统提供的style 即可<RatingBarstyle="?android:attr/ratingBarStyleIndicator"android:layout_width=“wrap_cont.._ratingbar样式修改
文章浏览阅读4.6k次,点赞6次,收藏11次。安装vs2017:参考vs2017下载和安装。安装cmake3.12.3:cmake是一个工程文件生成工具。用户可以使用预定义好的cmake脚本,根据自己的选择(像是Visual Studio, Code::Blocks, Eclipse)生成不同IDE的工程文件。可以从它官方网站的下载页上获取。这里我选择的是Win32安装程序,如图所示:然后就是运行安装程序进行安装就行。配置glfw3...._vs2017的opengl环境搭建(完整篇)
文章浏览阅读976次。MLC NAND,UBIFS_ubifs warning
文章浏览阅读2.2k次。计算机系统的两种存储器形式介绍时间:2016-1-6计算机系统的存储器一般应包括两个部分;一个是包含在计算机主机中的主存储器,简称内存,它直接和运算器,控制器及输入输出设备联系,容量小,但存取速度快,一般只存放那些急需要处理的数据或正在运行的程序;另一个是包含在外设中的外存储器,简称外存,它间接和运算器,控制器联系,存取速度虽然慢,但存储容量大,是用来存放大量暂时还不用的数据和程序,一旦要用时,就..._计算机存储器系统采用的是主辅结构,主存速度快、容量相对较小,用于 1 分 程序,外
文章浏览阅读5.6k次。1. STEP 7(Simatic Manager):STEP 7或者Simatic Manager是西门子PLC编程最常用的软件开发环境。4. STEP 7 MicroWin:STEP 7 MicroWn是一款专门针对微型PLC(S7-200系列PLC)的编程软件,是Simatic Manager的简化版。如果需要与PLC系统配合使用,则需要与PLC编程工具进行配合使用。除了上述软件之外,西门子还提供了一些配套软件和工具,如PLC模拟器、硬件调试工具等,以帮助PLC编程人员快速地进行调试和测试。_西门子plc编程软件
文章浏览阅读36次。【代码】HashMap扩容。_hashma扩容
文章浏览阅读2.9k次。1mvn dependency:copy-dependencies2 项目右键 -> Maven -> Disable Maven Nature3 项目右键 -> Configure -> Convert to Maven Project_maven资源加载不全,怎么重新加载
文章浏览阅读527次。DMLDML的全称是Database management Language,数据库管理语言。主要包括以下操作:insert、delete、update、optimize。本篇对其逐一介绍INSERT数据库表插入数据的方式:1、insert的完整语法:(做项目的过程中将字段名全写上,这样比较容易看懂)单条记录插入语法:insert into table_name (column_name1,......_dml的全称是
文章浏览阅读136次。可以参考: http://git.oschina.net/jrain-group/ 组织下的Java Modbus支持库Modbus-系列文章1、虚拟成对串口(1)下载虚拟串口软件VSPD(可在百度中搜索)image.png(2)打开软件,添加虚拟串口。在设备管理中,看到如下表示添加成功。..._最好用的 modebus调试工具