技术标签: 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)模式。 运行效果: 包裹模式 镜像模式 夹子模式 边界模式 一次镜像模式
文章浏览阅读565次。本文主要介绍如何使用C#通过OPC方式连接PLC,并提供了相应的程序和学习资料,以便读者学习和使用。OPC服务器是一种软件,可以将PLC的数据转换为标准的OPC格式,允许其他软件通过标准接口读取或控制PLC的数据。此外,本文还提供了一些学习资料,包括OPC和PLC的基础知识,C#编程语言的教程和实例代码。这些资料可以帮助读者更好地理解和应用本文介绍的程序。1.该程序是通讯方式是CSharp通过OPC方式连接PLC,用这种方式连PLC不用考虑什么种类PLC,只要OPC服务器里有的PLC都可以连。_c#opc通信
文章浏览阅读1.6w次,点赞3次,收藏10次。实践环境物理机:Windows10教育版,操作系统版本 17763.914虚拟机:Ubuntu18.04.3桌面版在Hyper-V中的刚安装好Ubuntu虚拟机之后,会发现鼠标滑动很不顺畅,也不能向虚拟机中拖拽文件或者复制内容。在VMware中,可以通过安装VMware tools来使物理机和虚拟机之间达到更好的交互。在Hyper-V中,也有这样的工具。这款工具可以完成更好的鼠标交互,我的..._win10 hyper-v ubuntu18.04 文件拷贝
文章浏览阅读156次。前言互联网时代,瞬息万变。一个小小的走错,就有可能落后于别人。我们没办法去预测任何行业、任何职业未来十年会怎么样,因为未来谁都不能确定。只能说只要有互联网存在,程序员依然是个高薪热门行业。只要跟随着时代的脚步,学习新的知识。程序员是不可能会消失的,或者说不可能会没钱赚的。我们经常可以听到很多人说,程序员是一个吃青春饭的行当。因为大多数人认为这是一个需要高强度脑力劳动的工种,而30岁、40岁,甚至50岁的程序员身体机能逐渐弱化,家庭琐事缠身,已经不能再进行这样高强度的工作了。那么,这样的说法是对的么?_类初始化一个静态属性 为线程池
文章浏览阅读1w次,点赞13次,收藏43次。说来也是惭愧,一直以来,在装环境的时候都会从官网下载Maven。然后再在idea里配置Maven。以为从官网下载的Maven是必须的步骤,直到今天才得知,idea有捆绑的 Maven 我们只需要搞一个配置文件就行了无需再官网下载Maven包以后再在新电脑装环境的时候,只需要下载idea ,网上找一个Maven的配置文件 放到 默认的 包下面就可以了!也省得每次创建项目都要重新配一次Maven了。如果不想每次新建项目都要重新配置Maven,一种方法就是使用默认的配置,另一种方法就是配置 .._安装idea后是不是不需要安装maven了?
文章浏览阅读45次。家是我们一生中最重要的地方,小时候,我们在这里哭、在这里笑、在这里学习走路,在这里有我们最真实的时光,用相机把它记下吧。 很多家庭在拍摄孩子时有一个看法,认为儿童摄影团购必须是在风景秀丽的户外,即便是室内那也是像大酒店一样...
文章浏览阅读429次。Dockerfile介绍Dockerfile是构建镜像的指令文件,由一组指令组成,文件中每条指令对应linux中一条命令,在执行构建Docker镜像时,将读取Dockerfile中的指令,根据指令来操作生成指定Docker镜像。Dockerfile结构:主要由基础镜像信息、维护者信息、镜像操作指令、容器启动时执行指令。每行支持一条指令,每条指令可以携带多个参数。注释可以使用#开头。指令说明FROM 镜像 : 指定新的镜像所基于的镜像MAINTAINER 名字 : 说明新镜像的维护(制作)人,留下_rocker/r-base镜像
文章浏览阅读223次。该系统将提供便捷的信息发布、物业报修、社区互动等功能,为小区居民提供更加便利、高效的服务。引言: 随着城市化进程的加速,小区管理成为一个日益重要的任务。因此,设计一个基于微信小程序的小区管理系统成为了一项具有挑战性和重要性的毕设课题。本文将介绍该小区管理系统的设计思路和功能,以期为小区提供更便捷、高效的管理手段。四、总结与展望: 通过本次毕设项目,我们实现了一个基于微信小程序的小区管理系统,为小区居民提供了更加便捷、高效的服务。通过该系统的设计与实现,能够提高小区管理水平,提供更好的居住环境和服务。_ssm基于微信小程序的公寓生活管理系统
文章浏览阅读635次。文章来源i春秋入坑Ubuntu半年多了记得一开始学的时候基本一星期重装三四次=-= 尴尬了 觉得自己差不多可以的时候 就吧Windows10干掉了 c盘装Ubuntu 专心学习. 这里主要来说一下使用Ubuntu的正确姿势Ubuntu(友帮拓、优般图、乌班图)是一个以桌面应用为主的开源GNU/Linux操作系统,Ubuntu 是基于DebianGNU/Linux,支..._ubuntu安装攻击工具包
文章浏览阅读335次。需求:C++中将BYTE型数组传递给Java中,考虑到内存释放问题,未采用通过返回值进行数据传递。public class demoClass{public native boolean getData(byte[] tempData);}JNIEXPORT jboolean JNICALL Java_com_core_getData(JNIEnv *env, jobject thisObj, jbyteArray tempData){ //resultsize为s..._jni引用byte[]
文章浏览阅读2.1k次,点赞5次,收藏30次。本教程代码开源:GitHub 欢迎star文章目录一、平面模型分割1. 代码2. 说明3. 运行二、圆柱模型分割1. 代码2. 说明3. 运行三、欧几里得聚类提取1. 代码2. 说明3. 运行四、区域生长分割1. 代码2. 说明3. 运行五、基于最小切割的分割1. 代码2. 说明3. 运行六、使用 ProgressiveMorphologicalFilter 分割地面1. 代码2. 说明3. 运行一、平面模型分割在本教程中,我们将学习如何对一组点进行简单的平面分割,即找到支持平面模型的点云中的所有._pclpy.pcl.pointcloud.pointxyzi转为numpy
文章浏览阅读141次。一 其实在 skyeye 上移植 arm-linux 并非难事,网上也有不少资料, 只是大都遗漏细节, 以致细微之处卡壳,所以本文力求详实清析, 希望能对大家有点用处。本文旨在将 arm-linux 在 skyeye 上搭建起来,并在 arm-linux 上能成功 mount NFS 为目标, 最终我们能在 arm-linux 里运行我们自己的应用程序. 二 安装 Sky..._nfs启动 arm
文章浏览阅读598次,点赞2次,收藏5次。00为了形成一个体系,想将前面学过的一些东西都拉来放在一起总结总结,方便学习,方便记忆。攻防世界 Pwn 新手攻防世界 Pwn 进阶 第一页01 4-ReeHY-main-100超详细的wp1超详细的wp203 format2栈迁移的两种作用之一:栈溢出太小,进行栈迁移从而能够写入更多shellcode,进行更多操作。栈迁移一篇搞定有个陌生的函数。C 库函数 void *memcpy(void *str1, const void *str2, size_t n) 从存储区 str2 _pwn snprintf