|
hello all..
i need some help to solve my problem..
i'd tried so many times to test this program...
it works very well if i did not include the FOR LOOP into my program.
i hope you guys can have a look at my program and figure out
what mistakes i did..thanks..
COLORREF OriginalPixelValue;
COLORREF NewPixelValuesss;
int PixelCount=0;
CoX=0; //coordinate-X
CoY=0; //coordinate-Y
for(int abcde=0; abcde<48; abcde++)
{
OriginalPixelValue=PixelValue(CoX,CoY);
NewPixelValuesss=(OriginalPixelValue | Data_0[PixelCount]) & Data_1[PixelCount];
GoWatermark(NewPixelValuesss,CoX,CoY);
PixelCount+=1;
if(CoX<m_bminfo1.bmwidth)
{
="" cox+="1;
" }
="" else
="" coy+="1;
" cox="0;
" <b="">}
COLORREF CThongThongThongDlg::PixelValue(unsigned int cox, unsigned int coy)
{
m_pixelvalue=GetPixel(m_dcMem1, cox, coy);
return m_pixelvalue;
}
BOOL CThongThongThongDlg::GoWatermark(unsigned long ValueValue, int CoordinateX, int CoordinateY)
{
NewSettedPixelValue=m_dcMem1.SetPixel(CoordinateX, CoordinateY, ValueValue);
UpdateData(FALSE);
return TRUE;
}
please take note at those lines in [B]BOLD[/B] .. when i put in this lines..to loop... the function does go..(i mean..the results i got is nothing...not working).. but if i delete those lines(those loops)..the function will run properly.. i really need to loop..its very important..
this is a school project.. where i need to read the bits values inside the 24-bit BITMAPS and do some modification of its RGB LSB.. i really need help.
thanks a lot.
thong
twh81@tm.net.my
...
|
|
|
|
|
Is this a "deliberate" typo?
if(CoX {<br />
CoX+=1;<br />
}
Shouldn't it be
if(CoX)<br />
{<br />
Cox += 1;<br />
}<br />
else<br />
{<br />
CoY+=1;<br />
CoX=0;<br />
}
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
His code is actually:
if(CoX < m_bmInfo1.bmWidth)
{
CoX+=1;
}
else
{
CoY+=1;
CoX=0;
}
|
|
|
|
|
Thanks, that is not what I see on IE6!
Perhaps he could give a link to the source code? I could not see anything obviously wrong. But it could have been screwed durin cut/paste.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
I don't see it either. Looks like IE6 swallowed the "<" as an HTML tag. He needs to wrap his sample code with <code></code> tags.
|
|
|
|
|
I can see two things that the for loop might affect.
1) the incrementing of PixelCount . This is used in the dereferencing of Data_0 and Data_1 . Are the arrays large enough?
2) the incrementing of CoX and CoY . Those are used by PixelValue() and GoWatermark() . Can those functions handle values greater than 0?
|
|
|
|
|
Hi all,
i've posted this question before and still no reply.....
when i create a new snap-in project (MMC) , the default menu in the menu bar is "Action, View, Favourties" i want to remove the "Favourites" menu item
i don't know how to do that. i know it is possible, i saw that sql server enterprize manager (which is a snap in object) removed it....so it is possible
can any1 help this time???
thanks in advanced
yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
error C2440: '=' : cannot convert from 'struct cell ** ' to 'struct cell *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
sortset.obj - 1 error(s), 0 warning(s)
The error appear to be in this line
temproot = (cmp_res < 0) ? &temproot->left : &temproot->right;
Anyone have a clues on how to fix this?
thank you very much ^_^
|
|
|
|
|
mmmm, smells like homework
Try removing the ampersands, assuming that temproot and the left and right nodes are of type "cell *"
For an explaination why, consult someone who can be bothered to explain pointers
--
Ian Darling
If I was any more loopy, I'd be infinite.
|
|
|
|
|
Hello, Can I add my aplication in Internet Explorer Rebar, How??
Visual C++ MFC
|
|
|
|
|
i create a font in the usual way :
first i set the properties (fontname, height, weight, angle, ...) in a LOGFONT struct,
then
myFont.CreateFontIndirect(&logfont);
then
pDC->SelectObject(&myFont);
then i call pDC->GetTextMetrics & pDC->GetTextExtent to to get some useful values
(total height, height of the ascent & descent parts), ... With these values i known exactly the boundaries of the text.
Problem : for a same height specified in the LOGFONT struct, the height values returned by GetTextMetrics vary with the angle of the text.
More precisely : if the angle is precisely 0 or 90 or 180 or 270°, the height is correct : if a draw a rectangle with the width & height computed from these values, it will perfectly fit around the text.
For any other values of the angle, the height is about 10 % too big.
|
|
|
|
|
how do you allocate memory in C? (not C++)
"new" is not supported in C.
|
|
|
|
|
Hi,
try malloc(), realloc() and free()
Greetings,
hph
|
|
|
|
|
In ansi C you allocate memory with
malloc();
and after usage you free the allocated memory with
free();
|
|
|
|
|
erm ...
look at malloc and free ( and associated function, calloc, realloc, ... )
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
loud and clear. doing it as we speak.
|
|
|
|
|
For example:
..... // Create 2 threads and save their handles to hThread1, hThread2
rgHandles[0] = hThread1;
rgHandles[1] = hThread2;
while (TRUE)
{
dwIndex = ::WaitForMultipleObjects(2, rgHandles, FALSE, INFINITE);
dwIndex -= WAIT_OBJECT_0;
...... // farther process at here
}
When the thread1 is terminated, the state of thread1 is set to signaled,
then WaitForMultipleObjects() returns the index 0 of the array.
But when the thread2 is terminated, the WaitForMultipleObjects() still returns
the index 0 not index 1.
I want WaitForMultipleObjects() to return the correct index, so I can process for this terminated thread.
who can help me?
Thanks a lot
|
|
|
|
|
Jin Yao wrote:
But when the thread2 is terminated, the WaitForMultipleObjects() still returns
the index 0 not index 1.
Are you sure that thread1 hasn't also terminated at the same time as thread2 ?
|
|
|
|
|
At the first time, thread1 terminates and WaitForMultipleObjects() returns the WAIT_OBJECT_0 + 0. The state of thread1 object is set to signaled.
When the thread2 ends, the thread2 object will also be set to signaled.
but at that time, the state of thread1 object is already signaled. So WaitForMultipleObjects() still returns the WAIT_OBJECT_0 + 0 not WAIT_OBJECT_0 + 1.
I wish WaitForMultipleObjects() can return the WAIT_OBJECT_0 + 1 when
thread2 ends.
Thanks
|
|
|
|
|
when a thread in the handle array becomes signalled and the wait satisfied,
handle the case and then remove that handle from the array (dec. the count,
shift over remaining handles as required..) That handle will remain valid
and signalled until you call CloseHandle on it, so you must remove it from
the wait.
|
|
|
|
|
Hi,
I'm new to all this Home Automation stuff, I would like to know if there are some libraries available ( in C++ or C#) for receiving and sending signals through this protocols ( or any wireless), or which vendors of components give some ActiveX or Dll's stuff to programmatically handle their controls.
Thanks in advance, Greetings
Braulio
|
|
|
|
|
Is there an easy way to format "1000000" so it would appear as "1,000,000"?
I know that the ',' depends on the locale so there should be a way...
Thanks
|
|
|
|
|
|
|
I have a Combo Box als Drop List from 1 to ...10 and a Control edit field.
I want to insert for each combo Box List a Number from Control Edit; just like to save Elements in Array.
For example: for 1 -----> 20.2
for 2------->7.7
for 3---->2.0
...
but if i return to 1 Index my element ist stored as 20.2 ans so ...
How can i do that??
Best Reguards!
|
|
|
|