Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not showing pixels.

Status
Not open for further replies.

jvff

Programmer
Joined
Apr 1, 2001
Messages
64
Location
BR
Hi,
I created this code for opening pixels but it doesn't work.

void CPCPlayerDlg::OnPaint()
{
unsigned short int index = 0;
unsigned long int x = 0;
unsigned long int y = 0;

if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);

// PC Player Pixels
while(index != 400)
{
SetPixel(dc, x, y, RGB(red[index], green[index], blue[index]));
}
}
else
{
CDialog::OnPaint();
}
} ThanQ, ;-)

JVFF (Janito Vaqueiro Ferreira Filho)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top