|
Did you have override the OnDraw function, if yes, check that, you may be drawing from the upper portion only, you have to get the scroll position and then have to draw that part of the image that actually comes on the screen, i.e. remove the top portion according to the scroll position.
http://www.priyank.in/
|
|
|
|
|
iam using the default OnDraw function that the frame work generates .
Hence Iam not overriding it.
laiju
|
|
|
|
|
laiju wrote:
OnDraw function that the frame work generates
AFAIK, framework already done that for you i.e. Overidden
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
R u saying i have to set the scroll position in ondraw where the first drawing exactly starts by specifying the method.
SetScrollPos().
laiju
|
|
|
|
|
|
Hey all,
I am new to this forum. Wish I was good at programming , so i cud have posted the solutions...unfortunately, I am not...Instead I have my own query....and am desperately seeking help...
I have this assignment submission next week. I have no idea about the logic for this assignment. My assignment is as follows:
*********************************************
Text segmentation from images with scenery + text. Obtain at least 10 images from newspapers, magazines etc. Some should be color. (3 min) Scan them as necessary. Devise three segmentation techniques to separate letters from background. Methods should be essentially automatic in operation. Methods: may include :Thresholding Local or Global, Color. Geometric Features, Texture
*************************************************
Can anyone help me out with the logic for this program? This thing is in C++. All I have done is binarise the input image.But I dont know how to proceed. Please help me out guys.
Cheers,
Raj
|
|
|
|
|
Do you know what Thesholding, Color, Geometric Features, Texture are referring to ?
Here's an obvious one - The text in all cases is going to be black - what if you looked for all pixels that were above a certain level and made them all white, which would hopefully leave you mostly with black text ? Any other black groups can be removed by checking that groups are individually within a certain size/shape.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey Christian,
Thanks for that reply. I did try that method out. But couldnt figure out a way to get rid of black images which were not text. You have referred to "checking the groups that are individually within a certain shape/size. How do I define that CERTAIN SHAPE/SIZE in the program?
Well, the thresholding in the program is the same what you suggested. Color refers to the cases where we have an image with say red text on it. so we have to seperate on the basis of color.
I am not quite sure how this method is going to work for color images.
Thanks anyways,
Raj
|
|
|
|
|
Hi,
i previously implemented an application using the SNMPUTIL code provided as a sample by Visual C++ guys. That sample used APIs to implement version 1 of SNMP. Now the problem is that i have to update it to version 3 of SNMP and i cant find any APIs that give me this functionality. Does any one know of any free samples or APIs that i can use.
Thanks in advance
regards
|
|
|
|
|
First of all, please downLoad my VC6 project with bug here [^]
In MyAppBarDlg.cpp , you will find these codes:
void CMyAppBarDlg::OnButton1()
{
dlg=new CAppBarDlg(IDD_DIALOG1,GetDesktopWindow());
ASSERT (dlg);
dlg->Create (IDD_DIALOG1);//here here, build the bar
dlg->m_pAppBar->AutoHide();//NoAutoHide() to disable it
dlg->m_pAppBar->SetAlwaysOnTop(TRUE);
}
the AppBar has 2 properties "AutoHide" & "AlwaysOnTop", I want both properties to work together, but it doesn't.
Who can do me a favor to fix this project? Please reply here or send me a mail.
thx very much!!!!!
My Email: orma_charf@hotmail.com
Ghostex@126.com
|
|
|
|
|
Please , help me~~~~
i must finish it in the next week.
|
|
|
|
|
Dude - everyone's problem is an 'emergency'. Why do you need to finish it next week ? There's not really anything useful on there as it stands - is it homework ? Are you required to make it stay on top and autohide at the same time ? Can you get a notification of when the window is shown if it is autohiding ? I'm wondering if you can call SetWindowPos just when the window is visible and when it hides again.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thx for your reply and i am sorry to use 'emergency'. But .........lots of reasons.
As this is a Shell Programming, and i've not had any experience about it, so i couldn't handle this problem.
It is my work, so i have to finish it as a part of project. By the way, it is not my homework and i am not a student.
Just because it is a Shell Object, the parent Wnd of the dialog is not the Desktop. its parent is a AppBar Object.
At the moment , i don't know where the problem would be. The project is based on the ShellApi SHAppBarMessage().
So i come here for help. i hope someone can help me to find and resolve the problem.
|
|
|
|
|
Can I use these methods Receive and Send of CSocket to send char or Unicode string like TCHAR ?
Thank you.
|
|
|
|
|
microsoftcertificate wrote:
Can I use these methods Receive and Send of CSocket to send char or Unicode string like TCHAR ?
Yes!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I created a CString StringData; on the Document Side
and also initialize it on the constructor as StringData = "";
Then i used the WM_CHAR, and typed this codes.
void CCaretsView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CCaretsDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDoc->StringData += nChar;//Error from here "It pop out an error saying that its error C2593: 'operator +=' is ambiguous
Invalidate();
CView::OnChar(nChar, nRepCnt, nFlags);
}
What Happen?
|
|
|
|
|
nChar is a UINT. conversing from int to char is implicit ( it happens all by itself ), but UINT is a completely different type. Try pDoc->StringData += (char)nChar;, that should do it ( or something similar to that, in any case ).
If you pass FALSE to your Invalidate, it won't call WM_ERASEBKGND, which will eliminate flicker. You realise that this code will not allow for the user to edit the string, but just to make it longer ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hello body, I want to use IShellView to refresh my desktop.So I write follow codes,but it does not work. Please help me .Thanks in advance.
//--------------------------
CoInitialize(NULL);
IShellFolder *ppshf=NULL;
IShellView *iShelview=NULL;
SHGetDesktopFolder(&ppshf);
hr=ppshf->CreateViewObject(::GetDesktopWindow(),IID_IShellView,(LPVOID*&iShelview);
iShelview->Refresh();
iShelview->Release();
ppshf->Release();
|
|
|
|
|
Hello geek's
want to ask you..
what a method you are suggesting for me in this my project:
I want to grab frames or whole video from two USB WebCam's simultaneously..
So, what I must to use to do it ?
I mean what technology:
VFW
DirectShow
WDM
or smf..
I working with MSVS C++
thanks a lot
oh, links, source codes are welcome..
|
|
|
|
|
I remember that in DotNet it is not allowed to create windows registered in one thread but to be created with a different thread.
When I do this with Win32Api, it works but with problems.
My sample used a second thread to create a button whose parent's the main window. It didn't display at all except that I added a MessageBox( modeless ) statement right after the window creation. The button works normal until I response to the messagebox.
I guess the messagebox could have involved a message loop in it such that the button could display normal if the messagebox existed.
Does anybody know the reason of this?
Is it possible to create windows with different threads?
Your help is appreciated.
|
|
|
|
|
Now I am confused. Are you using .NET or the Win32 API?
If you are using the Win32 API, yes, you can. I don't know about .NET to be able to answer your question.
What you might want to do is to call
MSG TheMsg;<br />
PeekMessage(&TheMsg, INVALID_HANDLE_VALUE, 0, 0, PM_NOREMOVE);
right away after creating a thread that will have use of messages (like a window or a thread that should respond to messages sent to it via PostThreadMessage) because the message queue for a thread does not exist until one of the message retrieval functions is called (GetMessage, PeekMessage, etc.)
Windows does not create a message queue for a thread unless the thread 'needs' it. This could be your problem.
|
|
|
|
|
I have the rather strange desire to draw a rectangle on top of a CHtmlview window in an MDI program. I naively thought that I could to this in OnPaint, but this would not seem to be the case.
Is it possible to draw on top of this view type, and if so , how does one go about it?
|
|
|
|
|
One way would be to grab the screen shot of the view window in a CDC and CBitmap in ChildFrame/MainFrame. Then Hide the view in ChildFrame/MainFrame. Then display the grabbed screenshot in the client area of ChildFrame/MainFrame. Then you can display any graphic on top of it. Then on another event, you can show the view again. This is the dirty way.
Another would be to create a floating modeless dialog box. Then using GDI, make it turn into a frame only with hollow center, like a rectangle. Then you can move the frame anywhere.
There must be better ways to do it. Maybe someone else can help.
this is this.
|
|
|
|
|
http://www.codeproject.com/cpp/rpnexpressionevaluator.asp
Above is top-rated but perhaps because it was written in 2003 the expr_eval.cpp needs a modern tweaking. As I wanted to learn the use of namespace in this code I'm unable to tweak it to compile cleanly. Using Dev-C++ v 4.9.9.2 and getting linker error. Can someone explain how to fix? Thanks!
>>Compiler: Default compiler
Compiler: Default compiler
Executing g++.exe...
g++.exe "D:\test\expr_eval.cpp" -o "D:\test\expr_eval.exe" -I"d:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"d:\Dev-Cpp\include\c++\3.4.2\backward" -I"d:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"d:\Dev-Cpp\include\c++\3.4.2" -I"d:\Dev-Cpp\include" -L"d:\Dev-Cpp\lib"
C:\DOCUME~1\Billy\LOCALS~1\Temp/ccMTbaaa.o(.text+0x1c4):expr_eval.cpp: undefined reference to `ExpressionEvaluator::calculateLong(std::string, long&)'
C:\DOCUME~1\Billy\LOCALS~1\Temp/ccMTbaaa.o(.text+0x2f9):expr_eval.cpp: undefined reference to `ExpressionEvaluator::calculateDouble(std::string, double&)'
C:\DOCUME~1\Billy\LOCALS~1\Temp/ccMTbaaa.o(.text+0x42c):expr_eval.cpp: undefined reference to `ExpressionEvaluator::calculateLong(std::string, long&)'
collect2: ld returned 1 exit status
Execution terminated <<
Here's the code:
#pragma warning (disable:4786)
#include <iostream>
#include <string>
namespace ExpressionEvaluator
{
enum
{
eval_ok = 0,
eval_unbalanced,
eval_invalidoperator,
eval_invalidoperand,
eval_evalerr
};
int calculateLong(std::string expr, long &r);
int calculateDouble(std::string expr, double &r);
}
using std::string;
using std::cout;
using std::endl;;
int main()
{
long result;
double resultdbl;
int err;
string s;
s = "1+2*(1-2-3-4)";
err = ExpressionEvaluator::calculateLong(s, result);
if (err != ExpressionEvaluator::eval_ok)
cout << "Error while evaluating!" << endl;
else
cout << "Evaluation of (int):" << s.c_str() << " yielded: " << result << endl;
s = "1.1/5.5+99-(4.1*(2+1)-5)";
err = ExpressionEvaluator::calculateDouble(s, resultdbl);
if (err != ExpressionEvaluator::eval_ok)
cout << "Error while evaluating!" << endl;
else
cout << "Evaluation of (double):" << s.c_str() << " yielded: " << resultdbl << endl;
ExpressionEvaluator::calculateLong("(1<2)*5+(99==99)", result);
//resultdbl = 3.14/4*5-66;
return 0;
}
|
|
|
|
|
That can't be all the code, it declares the existence of some functions, but does not define them. Hence the errors.
Christian Graus - Microsoft MVP - C++
|
|
|
|