Question about .NET
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]
I suggest you start out by reading the docs for the System.Net.WebClient class, then come back if you have more questions.
--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
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
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.
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.
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...
-Dan
Yes I realize im a n00b...
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]
[edited by - Nypyren on January 13, 2004 1:03:59 AM]
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)
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.
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...
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement