|
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
|
|
|
|
|
|
Hi, Everybody,
In the code underneath the compiler says there's no matching function for
GetNextComb.I marked the place where it refuses to compile the programme. What should I do ?
#include <cstdlib>
#include "IndexCombination.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <sstream>
using namespace std;
using namespace stdcomb;
struct Element
{
char name[6];
int numbers[30];
char chain[90];
};
const Element elements[] = {
{
"ia11",
{3,9,17,21,24,31,33,36,42,49,4,8,19,22,28,30,34,39,43,47,2,6,10,13,14,25,29,37,38,46},
"3,9,17,21,24,31,33,36,42,49,4,8,19,22,28,30,34,39,43,47,2,6,10,13,14,25,29,37,38,46"
}, {
"ia34",
{1,6,12,15,22,27,31,32,41,42,4,7,14,17,23,30,33,36,45,48,2,9,13,18,21,26,34,39,44,49},
"1,6,12,15,22,27,31,32,41,42,4,7,14,17,23,30,33,36,45,48,2,9,13,18,21,26,34,39,44,49"
}, {
"ia72",
{3,8,11,18,22,25,36,37,43,46,1,6,16,17,23,28,35,40,41,44,2,5,12,19,24,27,31,34,42,49},
"3,8,11,18,22,25,36,37,43,46,1,6,16,17,23,28,35,40,41,44,2,5,12,19,24,27,31,34,42,49"
}, {
"ia167",
{3,4,12,15,21,28,32,39,47,48,6,9,16,17,29,30,31,38,41,42,7,8,11,20,26,27,34,35,45,46},
"3,4,12,15,21,28,32,39,47,48,6,9,16,17,29,30,31,38,41,42,7,8,11,20,26,27,34,35,45,46"
}, {
"ia190",
{3,10,11,14,22,23,32,35,43,44,6,9,16,19,24,29,37,38,45,48,2,5,13,18,25,30,31,40,41,0},
"3,10,11,14,22,23,32,35,43,44,6,9,16,19,24,29,37,38,45,48,2,5,13,18,25,30,31,40,41,0"
}, {
"ia21",
{2,5,16,19,25,30,34,39,45,48,1,9,12,13,21,24,33,36,44,49,3,8,15,20,23,26,35,40,43,46},
"2,5,16,19,25,30,34,39,45,48,1,9,12,13,21,24,33,36,44,49,3,8,15,20,23,26,35,40,43,46"
}, {
"ia64",
{6,9,13,20,28,29,33,40,43,48,2,7,16,19,24,27,31,34,44,47,5,8,14,17,21,30,32,37,41,46},
"6,9,13,20,28,29,33,40,43,48,2,7,16,19,24,27,31,34,44,47,5,8,14,17,21,30,32,37,41,46"
}, {
"ia102",
{4,9,14,19,22,29,35,38,46,47,5,8,13,16,21,26,33,40,41,48,6,7,15,17,28,30,32,39,42,45},
"4,9,14,19,22,29,35,38,46,47,5,8,13,16,21,26,33,40,41,48,6,7,15,17,28,30,32,39,42,45"
}, {
"ia178",
{6,9,15,20,23,24,37,38,42,45,7,8,16,19,22,25,34,39,43,46,1,2,17,18,26,29,31,40,47,0},
"6,9,15,20,23,24,37,38,42,45,7,8,16,19,22,25,34,39,43,46,1,2,17,18,26,29,31,40,47,0"
}, {
"ia180",
{1,4,13,18,27,30,33,38,45,46,2,3,12,15,22,23,39,40,44,47,8,9,11,17,24,25,32,37,49,0},
"1,4,13,18,27,30,33,38,45,46,2,3,12,15,22,23,39,40,44,47,8,9,11,17,24,25,32,37,49,0"
}
};
int main(int argc, char *argv[])
{
CIdxComb cb;
cb.SetSizes(10,6);
vector<int> combination(6);
combination[0] = 0;
combination[1] = 1;
combination[2] = 2;
combination[3] = 3;
combination[4] = 4;
combination[5] = 5;
int Total = 0;
bool GetNextComb(std::vector<unsigned int> &vi);
while(cb.GetNextComb(combination))//the compiler stops here
{
Total++;
cout << "Combination number. " << Total << endl;
for (unsigned i = 0; i < combination.size(); i++)
{
const Element &element = elements[combination[i]];
cout << element.name << ": " << element.chain << endl;
}
cout << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
|
|
|
|
|
try to move the following line to outside main function
bool GetNextComb( std::vector<unsigned int> &vi );
Thanks and Regards,
Selvam,
http://www.wincpp.com
|
|
|
|
|
You probably need to define the GetNextComb function; here you simply declared it (and the declaration should be out of the "main" function.
This signature was proudly tested on animals.
|
|
|
|
|
The way you use GetNextComb, it's a method of CIdxComb. Your forward declaration (bool GetNextComb(std::vector<unsigned int> &vi); ) is for a free function, not a method of CIdxComb.
So, you need to add GetNextComb to the definition of CIdxComb.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
It looks like adding GetNextComb to the definition of CIdxComb doesn't solve anything. The compiler still wants a function. It's apparent that the problem is more complicated than I expected. Another evidence is that anybody can figure out how to write this section of the code.
However,
great thanks to everybody!
|
|
|
|
|
I'm new to Window API c c++ and had some real trouble with char datatype. Then I discovered basic_string class so I could do
std::string n="XXXX" and I was on my way. But now a new problem. Seems like there is always new problem.
Anyway, I writing windows program for CE and I discovered that the program must be UNICODE. In writing my own functions using 'string' all is well. But API functions use CHAR or WCHAR depending on compile. Since CE is unicode functions use the WCHAR. So now I'm somewhat stuck on how to use std::wstring versus std::string. My
simple code
std::wstring transType="MU"
fails with cannot convert char[3] to class std::basic_string..........
Anyone know what the problem is here?
|
|
|
|
|