Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Timer stuff Pin
Christian Graus14-Dec-01 10:26
protectorChristian Graus14-Dec-01 10:26 
GeneralRe: Timer stuff Pin
Rickard Andersson2014-Dec-01 10:59
Rickard Andersson2014-Dec-01 10:59 
GeneralRe: Timer stuff Pin
Christian Graus14-Dec-01 11:28
protectorChristian Graus14-Dec-01 11:28 
GeneralRe: Timer stuff Pin
Rickard Andersson2015-Dec-01 1:10
Rickard Andersson2015-Dec-01 1:10 
GeneralPotentially silly question about CWinThread Pin
nay14-Dec-01 8:45
nay14-Dec-01 8:45 
GeneralRe: Potentially silly question about CWinThread Pin
Alvaro Mendez14-Dec-01 10:52
Alvaro Mendez14-Dec-01 10:52 
GeneralRe: Potentially silly question about CWinThread Pin
nay14-Dec-01 12:09
nay14-Dec-01 12:09 
QuestionWhat am I missing here? Pin
clintsinger14-Dec-01 7:25
clintsinger14-Dec-01 7:25 
I have a function that is called be visual basic to draw to a picturebox. What that picturebox has is some video on it and I want to be able to change the colours of the image. I am trying to use CreateDIBSection but I seem to be missing something as I can't change the colors. I know that I have the right DC because I can draw a rectangle on it but I can't seem to get a proper bit set. Here is my code:

void __stdcall OverlayMask(long hWnd, long MaskArray)
{
RECT rc;
LONG lWidth = 0;
LONG lHeight = 0;
BITMAPINFO bmi;
HBITMAP hbmp = NULL;
BYTE* bpDIBits = NULL;

GetClientRect((HWND)hWnd, &rc);

lWidth = rc.right - rc.left;
lHeight = rc.bottom - rc.top;

ZeroMemory(&bmi, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = lWidth;
bmi.bmiHeader.biHeight = lHeight;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biXPelsPerMeter = 72;
bmi.bmiHeader.biYPelsPerMeter = 72;


HDC tmpDC = GetDC((HWND)hWnd);
hbmp = CreateDIBSection(
tmpDC, (LPBITMAPINFO)&bmi, DIB_RGB_COLORS,
(LPVOID*)&bpDIBits,
NULL, 0);

if (hbmp == NULL) AtlTrace("Unable to create DIB Section\n");
if (bpDIBits == NULL) AtlTrace("Unable to create DIBits\n");

HBRUSH hBrush = CreateSolidBrush(RGB(0xFF, 0x0F, 0xF0));
FillRect( tmpDC, &rc, hBrush ); // <- This works fine.

for (int i = 0; i < (lWidth*lHeight/3); i++) //<- This
{
*(bpDIBits++) = 0;
*(bpDIBits++);
*(bpDIBits++) = 0x66;
} // <- doesn't

AtlTrace("1) OverlayMask: %x %x", hWnd, MaskArray);

GdiFlush();

ReleaseDC((HWND)hWnd, tmpDC);
}

Thanks in advance,
Clint Singer
AnswerRe: What am I missing here? Pin
Joaquín M López Muñoz14-Dec-01 10:33
Joaquín M López Muñoz14-Dec-01 10:33 
Generalaccessing an ADO recordset pointer from another window Pin
14-Dec-01 7:13
suss14-Dec-01 7:13 
GeneralRe: accessing an ADO recordset pointer from another window Pin
Carlos Antollini14-Dec-01 7:28
Carlos Antollini14-Dec-01 7:28 
QuestionHow to find out unwanted DLL in a System? Pin
14-Dec-01 6:38
suss14-Dec-01 6:38 
AnswerRe: How to find out unwanted DLL in a System? Pin
Alvaro Mendez14-Dec-01 7:16
Alvaro Mendez14-Dec-01 7:16 
GeneralTrying to manipulate CStdioFile Pin
Stevieslu14-Dec-01 6:37
Stevieslu14-Dec-01 6:37 
GeneralRe: Trying to manipulate CStdioFile Pin
Alvaro Mendez14-Dec-01 7:19
Alvaro Mendez14-Dec-01 7:19 
Generalimplementing powerpoint presentation slide show Pin
Kuniva14-Dec-01 5:37
Kuniva14-Dec-01 5:37 
GeneralEmail Pin
SuperGeek14-Dec-01 5:31
SuperGeek14-Dec-01 5:31 
GeneralRe: Email Pin
Andrew Peace15-Dec-01 4:14
Andrew Peace15-Dec-01 4:14 
Generalswitching Media player active-x control to full screen Pin
Kuniva14-Dec-01 5:13
Kuniva14-Dec-01 5:13 
GeneralConverting int to CString Pin
Cam14-Dec-01 4:53
Cam14-Dec-01 4:53 
GeneralRe: Converting int to CString Pin
Joaquín M López Muñoz14-Dec-01 4:59
Joaquín M López Muñoz14-Dec-01 4:59 
GeneralRe: Converting int to CString Pin
Cam14-Dec-01 5:09
Cam14-Dec-01 5:09 
GeneralRe: Converting int to CString Pin
Alvaro Mendez14-Dec-01 5:16
Alvaro Mendez14-Dec-01 5:16 
GeneralRe: Converting int to CString Pin
Cam14-Dec-01 5:48
Cam14-Dec-01 5:48 
QuestionHow to Change the 'Caption' of a CPropertyPage Pin
14-Dec-01 3:39
suss14-Dec-01 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.