|
no, i wrote it all
i'm just stuck at this one crazy simple part that i can't figure out worth anything
and yeah, its a homework assignment
|
|
|
|
|
please !!
|
|
|
|
|
Why don't you look it up by yourself ?
Anyway, you could have a look at tutorial 6 (texture mapping) on this website[^] (you will probably need to have a look at the previous tutorials first).
|
|
|
|
|
hi, i want to create network applications i know a few things about sockets in windows and all that stuff i've been trying to start from scratch looking for manuals on the web about winsocks but they don't give much details about it. is there a good manual you recomend me to program network apps. like voip which is my main goal, something from beginners to advanced programers i'd appreciate your help if u could advise me about a good one i could find on the web i use c++ for my apps. thank you
|
|
|
|
|
|
Application has main window that launches some modal dialog boxes (Muse, Mmove, Mcount, Merase, Mexit). All work except Mcount which generates stack overflow error.
The functionality and code for Muse and Mcount are virtually identical except for a transaction identifier (MU vs MC). Mmove is basically the same except one extra text box.
It seems to me that memory used for these dialog boxes would be allocated when launched and then freed when closed. Consequently, there should not be a problem with the Mcount dialog box.
Can someone point me in the right direction as to how to troubleshoot this stack error with the Mcount dialog box.
Thank you.
|
|
|
|
|
the easiest way for some function to get a stack overflow is for it to call itself (either directly or indirectly) ad infinitum. Check your code, and if you don't find it, show us your relevant code.
|
|
|
|
|
Luc,
Thanks for the input. I did indeed have an infinite loop.
switch / case statements without the break;
|
|
|
|
|
I have several bmp files on my PC and I want to merge them programatically using C++ into a single bmp. I assume it is dead simple but I am unfamiliar w/ how to do this.
|
|
|
|
|
By merging, do you mean blending them into one image, or stitching them into one image? It's a matter of how to calculate the RGB values of the pixels in the target image. Depending on what you want in the target image, the algorithm will be different. You may have to design your own algorithm.
|
|
|
|
|
actually I have a series of enhanced meta files that I want to make into 1 large file (so just merge the pictures into one large picture). So lets say file1 is say 50 x 50 and I have a file2 say 50 x 50, I would like to join the files into 1 file that is say 50x100 or 100x50. Kind of like an html table when you create a row or a column of pictures strewn together.
Hope that kinda makes sense.
|
|
|
|
|
You can first calculate the target image's size based on all the small images' sizes, then create a blank image of the target size in memory. After that, load the small images one by one into memory, then render them to appropriate locations in the target image in memory.
For this purpose, the GDI+ Image class is your friend. If you like the old method, then device independent bitmap (DIB) can be used instead.
There are some useful information in MSDN Magazine. They are freely available online. For example, Paul DiLascia has some open source utilities that can be used in your project.
Hope this helps. Happy programming!
|
|
|
|
|
loyal ginger wrote: You can first calculate the target image's size based on all the small images' sizes, then create a blank image of the target size in memory. After that, load the small images one by one into memory, then render them to appropriate locations in the target image in memory.
For this purpose, the GDI+ Image class is your friend. If you like the old method, then device independent bitmap (DIB) can be used instead.
Rather than using image classes or DIBs and rendering into the new image, an alternative would be to use DIBSections. This would allow access to the raw pixel data, which could then be copied (and manipulated in any desired manner in the process) directly into the target pixels, avoiding the complexities of creating memory DC's, selecting images into them, blitting, inadvertently creating GDI resources leaks, etc, etc.
And I'm afraid Paul DiLascia, writer of PixieLib and countless invaluable MSDN articles, is no more.
|
|
|
|
|
Are you asking how you can open the two files and access their pixels directly? Because that's the part we can tell you quite easily. coming up with the algorithm for merging them is up to you.
|
|
|
|
|
it is easy to do.
Overview: create a big enough target image and copy all source images in it. Use the right coordinates for that. Than save and done.
This fine article should help: ImageStone[^]
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Howdy'
(for VS2008 + MFC Feature Pack)
When a menu contains too many items to fit the screen (or available space), it displays buttons to scroll the menu up and down to show hidden menu items.
Is there a name for these buttons or existing controls ?
Thanks.
Max.
This signature was proudly tested on animals.
|
|
|
|
|
Such scrollable menu is bad design. Users really dont like it. You should avoid it.
Use spy++ to look for details...
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I have a Visual Studio 2008 C++ CLR Windows Form application. The Windows Form has a Timer (timer1), a Status Strip (statusStrip1) which has a label (toolStripStatusLabel1) and a Text Box (textBox1). I am trying to display the local system time (localtime_s) in the Status Strip label (toolStripStatusLabel1). I enabled the Timer (timer1) and added the Timer function time1_Tick) to the Load event of the Windows Form. The application complies with no compiler or link errors. I also inserted some debug code to show the local system time in a Text Box (textBox1) to confirm that the local system time is working. It is. However, the local system time never appears in the Status Strip label (toolStripStatusLabel1). How do I fix this? Please be gentle. I am learning Visual C++. Here is the code:
private:
System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e)
{
time_t t = time(NULL);
tm s;
localtime_s(&s, &t);
String^ str = " ";
if (s.tm_hour < 13)
str = "AM";
else
str = "PM";
System::Windows::Forms::StatusStrip toolStripStatusLabel1;
toolStripStatusLabel1.Text = String::Format("{0}:{1}", s.tm_hour,
s.tm_min, str);
textBox1 -> Text = String::Format("{0}:{1} {2}", s.tm_hour,
s.tm_min, str);
}
|
|
|
|
|
I think you may need to force a refresh of your form to get the toolStripStatusLabel to repaint itself. Silly, I know, but ...
|
|
|
|
|
I simplified the code for getting the local system time and added a refreseh for the form, but it still isn't showing the local system time in the Status Stril Label.
<br />
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e)<br />
{<br />
DateTime^ thisDate = DateTime::Now;<br />
System::Windows::Forms::StatusStrip toolStripStatusLabel1;<br />
toolStripStatusLabel1.Text = String::Format("{0:t}", thisDate);<br />
Form1::Refresh();<br />
}<br />
|
|
|
|
|
spicture wrote: System::Windows::Forms::StatusStrip toolStripStatusLabel1;
toolStripStatusLabel1.Text = String::Format("{0:t}", thisDate);
I think I see what may be wrong; you are creating a temporary System::Windows::Forms::StatusStrip and setting its text, but it is not a child of your form. You need to update the status strip that is defined on your form.
|
|
|
|
|
Thank you. I finally got it. Here is the code.
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e)
{
DateTime^ thisDate = DateTime::Now;
System::Windows::Forms::StatusStrip toolStripStatusLabel1;
Form1::toolStripStatusLabel1 -> Text = String::Format("{0:f}", thisDate);
}
|
|
|
|
|
Thnak you. I fianlly gor it. Here is the code.
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e)
{
DateTime^ thisDate = DateTime::Now;
System::Windows::Forms::StatusStrip toolStripStatusLabel1;
Form1::toolStripStatusLabel1 -> Text = String::Format("{0:f}", thisDate);
}
|
|
|
|
|
spicture wrote: System::Windows::Forms::StatusStrip toolStripStatusLabel1;
This line is redundant; you are creating a temporary object but never using it.
|
|
|
|
|
Instead of time, if you put a fixed text string in there, does it show?
|
|
|
|