|
How are you using it (please post the code)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
here goes, all this for the first quadrant
///////////////////////////
x = 0;
y = 12;
degreeIncrement = 0;
for (---- about 30 times){
x = tan(degreeIncrement) * 12; ------>as 12 is the pyth theory (c square)
------> for the x position increment
y' = (12.0 * 12.0) - (x * x); -------> then square root y
y = sqrt(y);
plot line from origin to x,y + position on screen
m_degreeIncrement += 0.2; ------> or what ever value
} end loop
//////////////
Hope this helps, I am also aware of the cos, and sin functions formula
Thanks Simon
|
|
|
|
|
Having a hard time following the logic on your math. You're multiplying the tangent by 12, which appears to be the length of the hypotenuse since you using it later in what looks like the Pythagorean theorem. Since tangent has no relation to the hypotenuse, I'm not sure why you're doing that. (tangent = opposite / adjacent).
I'm not sure what you're trying to do, but if it's drawing "spokes" (like a wagon wheel) from the origin to various angles, then why wouldn't you just use something like:
x = length * cos(currentAngle)
y = length * sin(currentAngle)
And sweep thru the angles you want to cover?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Suppose i have 2 bmp files:- 1 containing alphabet AB & 2 containing alphabet AC.
Now i want to check how to compare both the images by comparing first (A-A & A-C) and (A-A & A-B).
As soon as A-C or A-B is found it should give a error message that images are not same.
So how Can i perform this unique work in MFC.
I will be very thankful to you.
Thank You
kaushal kishore sharma
|
|
|
|
|
Your new here so let me explain that re-posting questions is not generally views favorably.
If you want to learn about image processing try doing a google search. There is already plentiful resources on the internet for the subject.
Digital Image Processing[^]
There are even books[^]. Imagine that!
led mike
|
|
|
|
|
Wow.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Wow! Guys, we are getting so many bitmap comparing questions for past couple of days, I seriously think we should ask Chris to create a new forum for 'Bitmap Comparison' questions
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
Im using Win32API and i wanna know how to get
SetWindowText(hWnd, bunch of integers)
basically take a value from an integer variable in stick it where the LPCTSTR should be
ive tried CString and the .Format but it said CString undeclared identifier or soemthing
and i didnt know what library it is, not that this isnt MFC
any help on this conversion thing would be nice
|
|
|
|
|
You may use _stprintf , for instance
TCHAR szBuf[100];
INT i,j,k;
i=1;
j=2;
k=5;
_stprintf(szBuf, "%d %d %d", i, j, k);
SetWindowText(hWnd, szBuf);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
_stprintf': identifier not found
what library do i need to include
|
|
|
|
|
|
|
He must be use of pre tag for use of <.
|
|
|
|
|
#include <tchar.h>
Stupid HTML
|
|
|
|
|
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Well, you need to include an header file. As already pointed out by David Crow, the documentation [^] states clearly what you need in the requiremens section.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
An App dialog is being written that has variables declared as public in the AppDlg header file. Other dialogs used for tab sheets will required access to these variables.
Are there any good tutorials on how to do this using multiple dialogs that were generated in MSVC++6? Plain CPP isn't a problem, but getting the right initializations for the MFC derived dialogs for these variables eludes me at present.
Thanks in advance for any leads.
-jon
|
|
|
|
|
If the variables in question are members of the CWinApp -derived class, you can access them via the theApp object.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Well, MFC are indeed 'plain' C++ (BTW C++ is 'plain' by no means).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am using this code for comparing bitmaps.
it is compiling without error but when we execute it just a blank window arrives with a error message and ask to close the program.
Can anyone see what is the solution for this code.
void CPixelView::OnDraw(CDC* pDC)
{
CPixelDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
{
COLORREF color[255][255],color1[255][255];
CBitmap bitmap,bitmap1;
CString file1,file2,strText;
file1.Format("C:\\1.bmp");
file2.Format("C:\\3.bmp");
CDC dcMemory,dcMemory1;
int r[255][255],R[255][255];
HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,file1,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );//| LR_CREATEDIBSECTION);
HBITMAP hBitmap2 = (HBITMAP)::LoadImage(NULL,file2,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );
// Attach the loaded image to the CBitmap object.
bitmap.Attach(hBitmap1);
bitmap1.Attach(hBitmap2);
dcMemory.CreateCompatibleDC(pDC);
dcMemory1.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bitmap);
dcMemory1.SelectObject(&bitmap1);
pDC->BitBlt(0,0,200,200,&dcMemory,0,0,SRCCOPY);
pDC->BitBlt(300,300,700,700,&dcMemory1,0,0,SRCCOPY);
//for all the pixels
for(int i=0;i<48;i++)
{
for(int j=0;j<48;j++)
{
HDC hDC = ::GetDC(this->GetSafeHwnd());
HDC hDC1 = ::GetDC(this->GetSafeHwnd());
color[i][j] = ::GetPixel(hDC,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC);
r[i][j]=GetRValue(color[i][j]);
color1[i][j] = ::GetPixel(hDC1,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC1);
R[i][j]=GetRValue(color1[i][j]);
}
}//got the pixel values
}
}
Thank You
kaushal kishore sharma
|
|
|
|
|
kaushal kishore sharma wrote: it is compiling without error
Compilers don't catch errors like say, null pointer errors. Try debugging your code to find the problem.
led mike
|
|
|
|
|
thank you led mike.
i have done debugging of the program it is giving stack overflows dialog.
so you can check the code where it is giving me this error. My main moto is to compare bitmaps if you have any code related to this field do help me.
I will be very thankful to you.
Thank You
kaushal kishore sharma
|
|
|
|
|
|
Why are you selecting bitmaps into memory DCs, but then getting window DCs
to get pixel values from?
Where is the error occurring?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you sir.
i am doing my selecting bitmap work using memorydc since beginning.
i do not myself, where is the problem. It is executing but giving blank window and a dialog box written "pixel MFC Application has encountered a problem and needs to close. We are sorry for the inconvenience."
and after this i click on debug then it is giving "Stack overflow"
so please help me.
Thank You
kaushal kishore sharma
|
|
|
|