Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RenegadeKoolAid

Question about .NET

This topic is 5424 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am part of a technology fellowship at my school, and we are supplied projects by faculty. I was assigned one that no one else knows how to do, because I am the new guy this semester Anyway, the client wants an automated program that every twelve hours goes to a few static webpages containing pictures, and to print these pictures in groups of four per page. This all has to be done with no user interaction. Ive done a lot of C/C++ coding and some OpenGL coding but nothing like this, so I have no idea where to start. The closest thing to this project that I have done is a small TCP/IP messaging program. I was told that .NET would probably help with this, but I dont know. Can anyone help me out here? [edited by - RenegadeKoolAid on January 12, 2004 8:29:29 PM]

Share this post


Link to post
Share on other sites
Advertisement
I suggest learning winsock, its not hard and you could do it farely easily, provided you understand using the windows gdi (for printing the pics) it shouldnt be hard if you understand the gdi, winsock is maybe 30 functions max, including udp functions, which are not what you want anyways

Share this post


Link to post
Share on other sites
There is a useful winsock example somewhere on the web that downloads the html from a given web page. Once you download the html, you can scan that for the file name, then have it download the image.


OR....you can be really really cheap about it and just write a simple win32 app that moves the mouse over the favorites menu, and selects the page you need to download. via SetCursorPos(x,y)

then have the mouse select file->print.

this solution is prone to a slew of problems, but assuming no one will ever be using the computer when it runs, it should work.

Share this post


Link to post
Share on other sites
Hehe, that second idea is tricky, btw, do you have that html tutorial somewhere? cuz i have no idea what the packets look like that come from those servers (yah know, extra tags and sheit like that)

-Dan

Yes I realize im a n00b...

Share this post


Link to post
Share on other sites
Create a C# service that uses the .Net built-in webpage downloading stuff, like Arild mentioned. You'll have a project that consists of something like 100 lines of code - I kid you not. Printing is also bloody easy.

[edited by - Nypyren on January 13, 2004 1:03:59 AM]

Share this post


Link to post
Share on other sites
I believe hes using c++ though, but that doesnt rule out .NET (i happen to believe doing it essentially ground level with winsock is a better way to learn and do it though)

Share this post


Link to post
Share on other sites
Ok, I used Arild Fines idea and got it to download the images I need, but how would I print 4 images per page? Is there a print command to do something like this or will I need to create a new image, shrink each of the 4 images and then copy the data to the new larger image and print that? Thanks guys.

Share this post


Link to post
Share on other sites
Now is when you need knowledge of the windows gdi (something i avoid :-D) but its really not that terrible, look up printing with win32 gdi you should get some hits, sri i cant help anymore...

Share this post


Link to post
Share on other sites
So are you using C#? If so you should be able to to use the PrintDocument class to print the images. Look it up in the documentation. This will allow you to do the drawing using the Graphics object given to you. The Graphics object passed in to the Print event has all sorts of nifty GDI+ Drawing methods. You can use the DrawImage method to draw the image as whatever size you need it to be(in other words it allows you to scale the images). I''ve never made a program that prints but you should be able to do it like that.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!