|
ColourRGB interpolate(ColourRGB &c1, ColourRGB &c2, float pos);
makes such compilation error.
But this may not;
ColourRGB interpolate(const ColourRGB &c1, const ColourRGB &c2, float pos);
for code pixels[x][y] = interpolate(0x00000000, 0xffffffff, pos);
|
|
|
|
|
How to use CListCtrl to handle message
|
|
|
|
|
|
Hi, all message can't be responsed?
how to handle?
|
|
|
|
|
Derive a class from CListCtrl and overide the WindowProc() function. All the message to the list control goes throught that function.
|
|
|
|
|
|
|
Please elaborate your question, we cannot understand until, you gave some more clue. Please refer the link to ask the correct way to get maximum answers [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
thanks for all friends above;
I have a class derived CListCtrl, I tend to use this class to access the item associated with this class.
so I should use which message handle? all message can't be responded,why?
class CMyList : public CListCtrl
|
|
|
|
|
Hi Folks
I have tried load image using this ...
CImage img;
img.Load(_T("read.tif"));
Actully this is one full image .
but i need to cut in particular piece of that image.
image contains only two colors Black(RGB - 0 0 0) and white(RGB - 255 255 255)
i did only the load images ..but i dont know the further process what i can do??!!!!
Please help me !!!!!!!!11
Regards
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
You can use the Draw() function of the CImage to draw only a portion of the image. That is.
1. Create a memory dc
2. create a bitmap (createcompatiblebitmap() )
3. Select the bitmap to the dc.
4. Call CImage::Draw() funcion and pass the above created DC.
Now the bitmap that you created in step 2, will be having the image you want.
|
|
|
|
|
Thanks for your replay!!!!!!
void CImageReaderDlg::OnBnClickedButtonLoad()
{
CImage img;
img.Load(_T("read.tif"));
int nWidth=img.GetWidth();
int nHeight=img.GetHeight();
CClientDC dc(this);
CString str;
CPen ps;
for (double i=nWidth ; i > nWidth/2 ; i--)
{
for (double j=nHeight;j>nHeight/2;j--)
{
COLORREF clr=img.GetPixel(i,j);
int Rvalue=GetRValue(clr);
int Gvalue=GetGValue(clr);
int Bvalue=GetBValue(clr);
if(Rvalue == 255 && Gvalue == 255 && Bvalue == 255)
{
ps.CreatePen(PS_SOLID,i,RGB(255,0,0));
dc.SelectObject(&ps);
dc.MoveTo(i,j);
dc.LineTo(i,j);
}
}
}
}
its not drawing any colors in image ..what i can wrong here please suggest me !!
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
rajugis wrote: img.Load(_T("read.tif"));
Is the Load success? check the return value.
rajugis wrote: ps.CreatePen(PS_SOLID,i,RGB(255,0,0)); dc.SelectObject(&ps); dc.MoveTo(i,j); dc.LineTo(i,j);
Instead of the above, use SetPixel() function.
|
|
|
|
|
yes naveen ..its success .....
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Any luck after using SetPixel() ?
|
|
|
|
|
i have another one prob ..
when come to the loop ...its showing debug assertion failed !!
and i dont know how to use setpixel function
please help me !!!!!!!!
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
rajugis wrote: when come to the loop ...its showing debug assertion failed !!
At which line? Press the retry button and see at which line assertion occured.
rajugis wrote: and i dont know how to use setpixel function
Well check MSDN[^]
|
|
|
|
|
Hi naveen
void CCBIView::OnDraw(CDC* pDC)
{
CCBIDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CImage image;
CPen ps;
image.Load (_T("read.tif"));
int w,h;
w = image.GetWidth();
h = image.GetHeight();
int color;
COLORREF clr;
for(int i = 0 ; i < w ; i ++)
for(int j = 0 ; j < h; j ++)
{
color = image.GetPixel(i,j);
clr=image.GetPixel(i,j);
int Rvalue=GetRValue(clr);
int Gvalue=GetGValue(clr);
int Bvalue=GetBValue(clr);
if(Rvalue == 0 && Gvalue == 0 && Bvalue == 0)
{
pDC ->SetPixel (i,j,color);
}
}
}
now its ok but too slow ...
and how to make one vertical and horizontal line in the image ..
PLease.....
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
hi everybody, what will happen when i terminate a prcocess on the windows taskmanager?
Can the process make some action before killed?
|
|
|
|
|
Hi iceman,
Do you have a C/C++ related question? I fail to see how your question applies to the board topic.
Best Wishes,
-David Delaune
|
|
|
|
|
iceman8616 wrote: Can the process make some action before killed?
No. The process will not get any clue when it is terminated from the taskmanager.
|
|
|
|
|
Naveen wrote: No. The process will not get any clue when it is terminated from the taskmanager.
Hi Naveen,
Are you sure about that? The task manager uses two methods of terminating an application depending on which tab is selected. One of them can be ignored by an application.
Best Wishes,
-David Delaune
|
|
|
|
|
Randor wrote: task manager uses two methods of terminating an application depending on which tab is selected.
Hi David,
I mean the "EndProcess" option in the "Process" tab of the task manager( I guess it uses TerminateProcess()). It is the "End task" option in the "Application" tab that can be igonred( which sends a WM_CLOSE message ). right? Please correct me if I am wrong.
|
|
|
|
|
Yes, the 'End Task' button on the 'Application' tab simply sends a WM_CLOSE message. You can see this with the Spy++ utility. An application or malware could potentially ignore this message.
Best Wishes,
-David Delaune
|
|
|
|
|
I believe so - I think the window gets a WM_CLOSE or WM_QUIT first (can't remember which) and if it doesn't die pretty quickly, it then gets terminated with TerminateProcess.
I think that's how it works, anyway.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|