C 从对话框圆角中删除像素
c++ remove pixels from dialog round corners
我想删除一些在圆角的对话框窗口中可见的像素,我在C
中找不到任何解决方案这是我使用的代码,就我搜索而言,我认为我需要使用updateLayeredWindow函数,而不是WS_EX_LAYERED窗口中的SetLayereredWindowAttributes,但我找不到方法。
>有人知道如何从对话框的圆角上删除此像素吗?
代码:
INT_PTR CALLBACK WinProc(HWND hh,UINT mm,WPARAM ww,LPARAM)
{
HWND hX = GetDlgItem(hh,123);
switch(mm)
{
case WM_INITDIALOG:
{
// No Dialog Title Bar
SetWindowLong(hh, GWL_STYLE, 0); // With no border around the window
// Transparent Dialog In Selected Color
LONG ExtendedStyle = GetWindowLong(hh, GWL_EXSTYLE);
SetWindowLong(hh, GWL_EXSTYLE, ExtendedStyle | WS_EX_LAYERED);
SetLayeredWindowAttributes(hh, RGB(255, 128, 255), 0, LWA_COLORKEY);
//UpdateLayeredWindow(hh, NULL, NULL, NULL, NULL, NULL, RGB(255, 128, 255), 0, ULW_COLORKEY);
// Load the swf from our resources, extract first to temp path
TCHAR dx[1000] = {0};
GetTempPath(1000,dx);
TCHAR df[1000] = {0};
GetTempFileName(dx,L"swf",0,df);
DeleteFile(df);
wcscat_s(df,1000,L".swf");
DeleteFile(df);
ExtractDefaultFile(df,L"flash",0,0,L"data");
SendMessage(hX,AX_INPLACE,1,0);
SendMessage(hh,WM_SIZE,0,0);
// Set the object
IShockwaveFlash* p = 0;
CLSID iidx = __uuidof(IShockwaveFlash);
HRESULT hr = (HRESULT)SendMessage(hX,AX_QUERYINTERFACE,(WPARAM)&iidx,(LPARAM)&p);
if (p)
{
_bstr_t x(df);
hr = p->put_WMode(L"transparent");
hr = p->put_BackgroundColor(RGB(255,128,255));
hr = p->put_Movie(x);
// Notification
AX* iax = (AX*)SendMessage(hX,AX_GETAXINTERFACE,0,0);
if (iax)
{
axCookie = AXConnectObject(iax->OleObject,__uuidof(_IShockwaveFlashEvents),(IUnknown*)&fn,&cpc,&cp);
}
p->Release();
}
break;
}
case WM_SIZE:
{
RECT rc;
GetClientRect(hh,&rc);
SetWindowPos(hX,0,0,0,rc.right,rc.bottom,SWP_SHOWWINDOW);
return 0;
}
case WM_CLOSE:
{
EndDialog(hh,0);
return 0;
}
}
return 0;
}
int __stdcall WinMain( HINSTANCE hInstance,HINSTANCE,LPSTR,int)
{
OleInitialize(0);
AXRegister();
DialogBox(hInstance,L"DIALOG_MAIN",0,WinProc);
return 0;
}
我正在使用RGB的颜色(255、128、255),该颜色在闪光灯内不使用,否则它也从闪光灯播放器内部擦除了颜色。
预先感谢
- 创建一个win32功能的区域。即CreateLipticRegion,CreatectRgn ...
- 您必须使用setWindowRgn。
这是纯Win32讨论的链接。在这里,指向MFC样本的链接。将其转移到Winapi Pure
相关文章:
- 如何在不产生任何垃圾的情况下获得C中的像素
- 在C++中使用GDAL可以将图像的像素坐标转换为lat,long吗
- 如何在24位SDL_Surface上设置像素的颜色
- 如何从SDL_Surface获取特定像素的颜色
- 如何将CMSampleBufferRef/CIImage/UIImage转换为像素,例如uint8_t[]
- 在C++中查找像素 RGB 数据的最快方法是什么?
- 是否可以从 OpenGL 缓冲区获取原始大小的像素?
- 选择基于另一个垫子的非零像素的cv::Mat的一部分?
- 如何使用 sdl2 快速绘制像素网格?
- 如何在C++中进行像素操作? - Linux
- 他们如何将红外锁定像素转换为镜头前方 1m 的正常平面上的位置
- 访问随机图像像素的快速方法,最多一次
- OpenCV 像素访问点与 at() - 不同的值
- 如何使用 freetype2 访问单色位图中的像素状态
- 尝试渲染像素坐标时,简单线条渲染失败
- 计算另一个图像像素满足条件的像素值的平均值
- 如何返回定义良好的内存部分?例如来自图像数据的像素的颜色值
- 图像分割 - 删除C 中不需要的像素
- C 从对话框圆角中删除像素
- SDL:使现有表面透明/删除所有像素数据