Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
#include <afxwin.h> #include <gdiplus.h> #pragma comment( lib, "gdiplus.lib" ) using namespace Gdiplus; class Button :public CFrameWnd { public: // Konstruktor Button() { const char *cWndClass = AfxRegisterWndClass( CS_HREDRAW|CS_VREDRAW , NULL,CreateSolidBrush(RGB(0,0,0)) ,NULL); CreateEx(WS_EX_LAYERED| WS_EX_TOPMOST /*|WS_EX_TOOLWINDOW*/ ,cWndClass ,_T(""),WS_VISIBLE|WS_POPUP, 0,0,200,200,NULL, NULL, NULL ); } }; class FWinApp :public CWinApp { Button *wnd; public: BOOL InitInstance() { // Start GDI+ GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); wnd = new Button(); wnd->ShowWindow(1); // Blend Structur BLENDFUNCTION hBlend; hBlend.BlendFlags = 0; hBlend.BlendOp = AC_SRC_OVER; hBlend.SourceConstantAlpha = 255; hBlend.AlphaFormat = AC_SRC_ALPHA; // Create Graphics and Bitmaps CDC hScreen = CDC(); CDC hCDC; hCDC.CreateCompatibleDC(&hScreen); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen,200,200); SelectObject(hCDC,hBitmap ); // Draw Graphics *hGraphics = Graphics::FromHDC(hCDC); hGraphics->Clear(Color(255,200,0,255)); // Set Position/Size POINT hPoint = {0, 0}; // Screen Position SIZE hSize = {200,200}; // Window Size POINT pptSrc = {0,0}; // // Display wnd->UpdateLayeredWindow(&hScreen,&hPoint,&hSize,&hCDC,&pptSrc,0,&hBlend,ULW_ALPHA); while (true) {}; return TRUE; } }; FWinApp theApp; |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Faweyr« (03.12.2011, 23:33)
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 |
// Create Graphics and Bitmaps CDC hScreen = CDC(); CDC hCDC; hCDC.CreateCompatibleDC(&hScreen); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen,200,200); SelectObject(hCDC,hBitmap ); // Draw Graphics *hGraphics = Graphics::FromHDC(hCDC); hGraphics->Clear(Color(255,200,0,255)); |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Faweyr« (04.12.2011, 08:51)
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
#include <afxwin.h> #include <gdiplus.h> #pragma comment( lib, "gdiplus.lib" ) using namespace Gdiplus; class Button :public CFrameWnd { public: // Konstruktor, Destruktor Button() { const char *cWndClass = AfxRegisterWndClass( CS_HREDRAW|CS_VREDRAW , NULL,CreateSolidBrush(RGB(0,0,0)) ,NULL); CreateEx(WS_EX_LAYERED| WS_EX_TOPMOST /*|WS_EX_TOOLWINDOW*/ ,cWndClass ,_T(""),WS_VISIBLE|WS_POPUP, 0,0,200,200,NULL, NULL, NULL ); } void Button::Draw() { // Blend Structur BLENDFUNCTION hBlend; hBlend.BlendFlags = 0; hBlend.BlendOp = AC_SRC_OVER; hBlend.SourceConstantAlpha = 255; hBlend.AlphaFormat = AC_SRC_ALPHA; // Create Graphics and Bitmaps CDC hScreen = CDC(); CDC hCDC; hCDC.CreateCompatibleDC(&hScreen); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen,200,200); SelectObject(hCDC,hBitmap ); // Draw Graphics *hGraphics = Graphics::FromHDC(hCDC); hGraphics->Clear(Color(255,200,0,255)); // Set Position/Size POINT hPoint = {0, 0}; // Screen Position SIZE hSize = {200,200}; // Window Size POINT pptSrc = {0,0}; // // Display UpdateLayeredWindow(&hScreen,&hPoint,&hSize,&hCDC,&pptSrc,0,&hBlend,ULW_ALPHA); } }; class FWinApp :public CWinApp { Button *wnd; public: BOOL InitInstance() { // Start GDI+ GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); wnd = new Button(); wnd->ShowWindow(1); while (true) { wnd->Draw(); }; return TRUE; } }; FWinApp theApp; |
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
#include <afxwin.h> #include <gdiplus.h> #pragma comment( lib, "gdiplus.lib" ) using namespace Gdiplus; class Button :public CFrameWnd { public: // Konstruktor, Destruktor Button() { const char *cWndClass = AfxRegisterWndClass( CS_HREDRAW|CS_VREDRAW , NULL,CreateSolidBrush(RGB(0,0,0)) ,NULL); CreateEx(WS_EX_LAYERED| WS_EX_TOPMOST |WS_EX_TOOLWINDOW ,cWndClass ,_T(""),WS_VISIBLE|WS_POPUP, 0,0,200,200,NULL, NULL, NULL ); SetTimer(1,270,NULL); } ~Button() {} void Button::OnTimer (UINT n) { // Blend Structur BLENDFUNCTION hBlend; hBlend.BlendFlags = 0; hBlend.BlendOp = AC_SRC_OVER; hBlend.SourceConstantAlpha = 255; hBlend.AlphaFormat = AC_SRC_ALPHA; // Create Graphics and Bitmaps CDC hScreen = CDC(); CDC hCDC; hCDC.CreateCompatibleDC(&hScreen); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen,200,200); SelectObject(hCDC,hBitmap ); // Draw Graphics *hGraphics = Graphics::FromHDC(hCDC); hGraphics->Clear(Color(255,200,0,255)); // Set Position/Size POINT hPoint = {0, 0}; // Screen Position SIZE hSize = {200,200}; // Window Size POINT pptSrc = {0,0}; // // Display UpdateLayeredWindow(&hScreen,&hPoint,&hSize,&hCDC,&pptSrc,0,&hBlend,ULW_ALPHA); } DECLARE_MESSAGE_MAP() }; BEGIN_MESSAGE_MAP(Button,CFrameWnd) ON_WM_TIMER() END_MESSAGE_MAP() class FWinApp :public CWinApp { Button *wnd; public: BOOL InitInstance() { // Start GDI+ GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); wnd = new Button(); wnd->ShowWindow(SW_SHOW); return TRUE; } BOOL ExitInstance() { return TRUE; } }; FWinApp theApp; |
Werbeanzeige