|
wow, lol they are like mega small had to zoom in to see them will the stretchblt thing work well with that kinda stuff then???
|
|
|
|
|
Hehe - from over 500kb of image down to around 20kb - nice huh?
Yeah, stretchblt should work fine with them. You only need to stretch the toplow, tophigh, left, right and bottom images - that's why these are all only 1 pixel wide or high. If for whatever reason StretchBlt doesn't work, you can just draw a piece repeatedly until you have a border of the appropriate length.
Not sure which approach the article I linked you to uses, but it'd be one of the two.
|
|
|
|
|
havent finished going through the source code of the article but i loaded the toplow bit into a region and used the stretchblt and it worked beautifully now just have to create a function to put them all together lol, will take me a while im sure heh, thank you very much for your help, couldnt have asked for better
|
|
|
|
|
I would do something like this...
case WM_LBUTTONDOWN:
if(
{
SetCapture(hWnd);
mResize = TRUE;
}
break;
case WM_LBUTTONUP:
{
<code>if (mResize)
{</code>
ReleaseCapture();
mResize = FALSE;
<code>}</code>
}
break;
Beyond that, if its not resizing properly, you'll need
to debug your resizing code
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello, friends~
I have some questions about the MFC programming.
I use the Visual studio 2005 and use Multi-byte-code.
I execute this code..(this is in CView)
///////////////////////////////////////////////////////////////////////////////////
void CRETURN1View::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
int nCharIndex;
nCharIndex = m_strOutText.GetLength();
if(nChar == VK_BACK)
{
m_strOutText.Delete(nCharIndex-1, 1);
}
else
{
m_strOutText += nChar;
}
Invalidate();
CView::OnChar(nChar, nRepCnt, nFlags);
}
//////////////////////////////////////////////////////////////////////////////
this error is occur..
// error C2593: 'operator +=' is ambiguous //
I don't know why this error is occur
ps. m_strOutText is CString data type.
plz tell me what is problem...
|
|
|
|
|
In VC6.0 its possible. But in VS2005 rules are a bit more strict and you've to convert the UINT to TCHAR since in CString += doesn't expects a UINT to be added to it.
Well, for making it compilable, just cast to TCHAR as follows,
m_strOutText += (TCHAR)nChar;
m_strOutText += static_cast<tchar>( nChar );</tchar>
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
FR2ESOD wrote: // error C2593: 'operator +=' is ambiguous //
m_strOutText += nChar;
The compiler is not sure what to make of this.
Bram van Kampen
|
|
|
|
|
Hi,
I have a DialogBox with a Single line edittext control
Whenever I enter a number and use GetDlgItemText reterive the data
Nulls get inserted between each character/byte
e.g. if I enter 123456 in the Editext it appears in Memory
as 31 00 32 00 33 00 34 00 35 00 36
is there maybe a ES_ style I should add to the resource file when
Creating the edit control or Maybe sending a message to the edit
control to Format the text ???
thankx
|
|
|
|
|
If you're doing a UNICODE build (i.e. the default with Visual Studio 2003 and above) then there's nothing strange you're getting a UNICODE string.
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]
|
|
|
|
|
|
Just changed The Visual Studio Build "Character Set" in the
Configuration Properties->General->Project Defaults->character Set to "Not Set" from Unicode
and it worked thankx
|
|
|
|
|
Hi,
How to set null to 2*2 static array in c++ after declaration.
I tried like this
ULONGLONG Array[2][2];
memset(Array,0x0,sizeof(ULONGLONG)*2*2);
What is wrong with this?
|
|
|
|
|
You could initialize it like this -
ULONGLONG Array[2][2] = { {0,0}, {0,0}};
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Or simply:
ULONGLONG Array[2][2] = {0};
"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
|
|
|
|
|
MPTP wrote: What is wrong with this?
It is not wrong, Anyway Jijo rai's one [^] is much more better.
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]
|
|
|
|
|
Hi All,
I'm a bit perplexed at the behavior of the ShellExecute function. I have two apps. One is called Test.exe, and the other is called suicide.exe. It's pretty obvious what suicide.exe does: it suicides. It deletes itself and Test.exe. When I run suicide.exe manually (dblclicking it), it works fine. Test.exe and Suicide.exe are gone.
Unfortunately, when I try to use a ShellExecute from Test.exe to run Suicide.exe...well, the results are totally disastrous. In the WinMain() function in Suicide.exe, I put a Sleep(2000) followed by DeleteFile("Test.exe"). In Test.exe, after I call ShellExecute(...), I immediately call CDialog::OnClose(). So supposedly, after the ShellExecute function is run, Suicide.exe is supposed to start, and Test.exe is supposed to close itself, then after 2 seconds Suicide.exe kills both files.
That's what should happen theoretically. What is actually happening is that Suicide.exe succeeds in killing itself, but even after the 2 second delay Test.exe is still running. So when it tries to kill Test.exe, it obviously fails. And then, for some unknown reason, Test.exe keeps on starting copies of Suicide.exe forever, until I terminate Test.exe. After I do terminate Test.exe, all the spawned Suicide.exe's are gone, and the two files are also killed.
My two questions: Why does this behavior occur instead of what should occur theoretically? And could anyone help me resolve this?
Thanks in advance.
Btw, it took me quite a lot of thinking to explain this properly. If any part of this is unclear just ask and I'll try my best to explain.
|
|
|
|
|
hmm
You are trying to delete a running exe ? I think the OS may object against that.
Bram van Kampen
|
|
|
|
|
No, I'm not trying to kill a running exe. As I mentioned, Test.exe is supposed to close, and after a 2 second delay Suicide.exe is supposed to delete Test.exe and itself.
My question is why Test.exe doesn't close even when I call TerminateProcess right after I run Suicide.exe
|
|
|
|
|
well, i think you should try to move it into recycler directory.
|
|
|
|
|
Suicide.exe works fine, as I previously mentioned. The problem is getting Test.exe to close BEFORE suicide.exe tries to delete both files.
|
|
|
|
|
hxhl95 wrote: In Test.exe, after I call ShellExecute(...), I immediately call CDialog::OnClose().
I imagine that is NOT closing the dialog or ending the app.
Assuming the dialog is the app's main window:
If the dialog is modal, call EndDialog().
If the dialog is modeless, use DestroyWindow().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
- whacks myself on the head -
I was nearly going to try exit(0).
Thanks for your help.
modified on Monday, October 13, 2008 1:27 PM
|
|
|
|
|
Hi All,
I'm currently working on my project (which try to perform degree reduction for a Bezier curve).
I've spent a long time trying to find library or useful class to help me perform matrix inversion.
For a degree reduction in Bezier's curve (let's say from degree 3 to degree 2)
B2: bezier curve for degree of 2 (which is unknown in this case)
B3: bezier curve for degree of 3 (which is a given in this case)
M: A matrix involving bezier curves (I already wrote a function to get this matrix)
The fomula to find B2 is as followed:
B2 = inverse(Mtranspose * M) * M * B3
I wrote function to perform matrices multiplication and matrix transpose. I'm having a great deal of difficulty integrating TNT::JAMA_LU and other classes I've found. I just want to do an inverse of a matrix (dimension NxN)
I've spent too much time trying to figure out how to do matrix inversion and that's not even the main point of my project.
Can anyone provide me with good resources? I really appreciate any help in advance.
|
|
|
|
|
You may have a look at Numerical Recipes in C++ [^]. There's also a free online version of the older Numerical Recipes in C book [^].
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]
|
|
|
|
|
Try doing a code search on krugle, koders or google code search. There is some code floating around.
Kevin
|
|
|
|