|
Well, I guess the same way I filled the search box on google's page.
Have you tried setting the InnerText property?
Maybe you could give me the link to the page you want to interact with and I'll try myself.
|
|
|
|
|
Alright I finnally got everything working except the button. To my knowledge i don't see the button in the source code. It just says
Did you get my email?
-- modified at 2:20 Tuesday 29th May, 2007
|
|
|
|
|
I didn't check my email yesterday. I'll read it in the afternoon(about 4-5 hours from now), as I'm not allowed to use my private email at work.
Did you use Firebug to identify the web controls? If not, please do so. You'll see why.
|
|
|
|
|
Well I actually took a look at another guys source and it pulls up the web page in the program itself. So I just had to modify it. The only problem is there is no button (in the web site) after you input the username and password. The site uses the php post method. Like www.site.net/login.php?user=Myusername&password=mypassword. But they have mypassword encrypted. So right now i'm trying to find away to either have the web browser click the button (but not seeing one in the source code) I think I will have to go with a way to manually click it.
|
|
|
|
|
Hi,
Is there a way to programatically determine if Office11 or which version of it is installed in the local machine? TIA.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Project: I'm tring to use iTextSharp assembly to create and print a pdf file in a web application.
Input: pre created template pdf file; dynamic data entry from web page.
Output: print out pdf file with data entry; save pdf with data entry as image to database.
Step 1.Generate pdf file based on pre-created pdf template file and data entered through web page.
Step 2.Print out the pdf file generated from step1.
Problem:
I'm able to persute step 1 using fdf.
What is the best way and how to print out the pdf file created from step1 in web application?
What is the best way to store the pdf file into SQL server database?
Your input is well appreciated.
|
|
|
|
|
I had to do a similar thing, but in a desktop application. In order to print the file I start Adobe Reader with command line parameters, which tell it to print the file.
With you web application, a problem may arise when trying to launch Acrobat Reader using the Process.Start() method. I'm not sure if you're allowed to do that.
|
|
|
|
|
First, thank you for the reply, I did use Process.Start, it works ok, but I try to not using COM, but using .net technic. Any other way?
Thanks,
|
|
|
|
|
This is a new question, after I created a PDF file with data entry using iTextSharp, what is the best way to save it in the situation I need to bring back this PDf file.
Thanks in advance.
|
|
|
|
|
Dear Friends:
How can a program set the caret position in the text of the editable ComboBox? I set the ComboBox.SelectionStart and then ComboBox.SelectionLength. The caret for insertion automatically moved to the end of the selection, i.e. at the position, SelectionStart + SelectionLength. I want to move the caret to the beginning of the selection, i.e. at the position, SelectionStart. I could not find a property or method which can set the position of the caret. Thanks!
|
|
|
|
|
So I've decided to start diving into minor game programming and getting a better understanding of how it's done by making a few games this summer. The first is this clone of the Zombie Simulator that you might of seen by Kevan Davis. I'm not trying to be original mind you just to learn. I figured i'd be a pretty easy start but I've come to a dead stop.
I've managed to randomly create "buildings" but I'm having issues with my "Being" class being able to manipulate the outsider world. In the main program class "Zombie" I have my bitmap image set to protected which SHOULD allow for the Being class to manipulate it since it is a derived class from Zombie. So maybe someone can help me. What the hell am I doing wrong? BTW I know not all the methods are completely...but I must first be able to display the object before I continue onward. Below is all the code I've done. I hope it isn't to long.
using System; <br />
using System.Drawing; <br />
using System.Drawing.Drawing2D; <br />
using System.Collections; <br />
using System.ComponentModel; <br />
using System.Windows.Forms; <br />
using System.Data; <br />
<br />
namespace ZombiesSim<br />
{<br />
public class Zombie : System.Windows.Forms.Form <br />
{<br />
private System.ComponentModel.IContainer components;<br />
<br />
private bool _doBuffer = true;<br />
private int freeze, x, y, bwidth, bheight;<br />
private Color human, panichuman, zombie, wall;<br />
private int num = 1000;<br />
private int speed = 1;<br />
private Graphics g;<br />
private bool gxstart;<br />
private Being bee;<br />
public Bitmap world;<br />
protected int width, height;<br />
private Random rand = new Random();<br />
<br />
<br />
public Zombie() <br />
{ <br />
InitializeComponent(); <br />
<br />
human = Color.Purple;<br />
panichuman = Color.Pink;<br />
zombie = Color.Lime;<br />
wall = Color.DimGray;<br />
<br />
width = this.ClientSize.Width;<br />
height = this.ClientSize.Height;<br />
<br />
world = new Bitmap( width, height );<br />
g = Graphics.FromImage( world );<br />
gxstart = true;<br />
<br />
freeze = 0;<br />
}<br />
<br />
protected override void Dispose( bool disposing ) <br />
{ <br />
if( disposing ) <br />
{ <br />
if (components != null) <br />
{ <br />
components.Dispose(); <br />
} <br />
} <br />
base.Dispose( disposing ); <br />
} <br />
<br />
#region Windows Form Designer generated code <br />
private void InitializeComponent() <br />
{ <br />
this.components = new System.ComponentModel.Container(); <br />
this.SuspendLayout(); <br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); <br />
this.ClientSize = new System.Drawing.Size(666, 666); <br />
this.Name = "Zombie Simulation"; <br />
this.Text = "Zombie Simulation"; <br />
this.ResumeLayout(false);<br />
this.MaximizeBox = false;<br />
this.FormBorderStyle = FormBorderStyle.FixedDialog;<br />
this.Shown += new System.EventHandler(this.Zombie_Shown);<br />
}<br />
#endregion<br />
<br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.Run(new Zombie());<br />
}<br />
<br />
private void Zombie_Shown(object sender, EventArgs e)<br />
{<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
if( world != null && gxstart == true )<br />
{<br />
<br />
g.Clear(Color.Black);<br />
<br />
for( int i = 0; i < 100; i++)<br />
{<br />
x = rand.Next( this.ClientSize.Width );<br />
y = rand.Next( this.ClientSize.Height );<br />
bwidth = rand.Next( 30, 90 );<br />
bheight = rand.Next( 30, 90 );<br />
g.FillRectangle( new SolidBrush( wall ), x, y, bwidth, bheight );<br />
}<br />
<br />
for( int i = 0; i < 30; i++)<br />
{<br />
x = rand.Next( this.ClientSize.Width );<br />
y = rand.Next( this.ClientSize.Height );<br />
bwidth = rand.Next( 40, 60 );<br />
bheight = rand.Next( 40, 60 );<br />
g.FillRectangle( new SolidBrush( wall ), x, y, bwidth, bheight );<br />
}<br />
<br />
gxstart = false;<br />
<br />
}<br />
<br />
setup();<br />
<br />
if(_doBuffer)<br />
{<br />
e.Graphics.DrawImageUnscaled( world ,0,0);<br />
}<br />
}<br />
<br />
public void setup()<br />
{<br />
bee = new Being();<br />
<br />
}<br />
<br />
protected override void OnPaintBackground(PaintEventArgs pevent) <br />
{ <br />
} <br />
<br />
protected override void OnSizeChanged(EventArgs e)<br />
{<br />
<br />
}<br />
}<br />
<br />
public class Being : Zombie<br />
{<br />
private int xpos, ypos, dir;<br />
private int type;<br />
private int active;<br />
private Random rand = new Random();<br />
private Color hue;<br />
<br />
public Being()<br />
{<br />
dir = rand.Next( 1, 4 );<br />
type = 1;<br />
active = 0;<br />
hue = Color.Purple;<br />
position();<br />
world.SetPixel( 5, 5, Color.Purple );<br />
}<br />
<br />
public int[] getposition()<br />
{<br />
int[] pos = { xpos, ypos };<br />
return pos;<br />
}<br />
<br />
public void position()<br />
{<br />
for( int j = 0; j < 100; j++ )<br />
{<br />
xpos = rand.Next( 1, width - 1);<br />
ypos = rand.Next( 1, height - 1);<br />
if( world.GetPixel( xpos, ypos ) == Color.Black )<br />
j = 100;<br />
}<br />
}<br />
<br />
<br />
<br />
public void infect( int x, int y )<br />
{<br />
if( x == xpos && y == ypos )<br />
type = 2;<br />
}<br />
<br />
public void infect()<br />
{<br />
hue = Color.Lime;<br />
type = 2;<br />
}<br />
<br />
public void uninfect()<br />
{<br />
hue = Color.Purple;<br />
type = 1;<br />
}<br />
<br />
public void look( int x, int y )<br />
{<br />
dir = rand.Next( 1, 4 );<br />
<br />
if( dir == 1 )<br />
y++;<br />
if( dir == 2 )<br />
x++;<br />
if( dir == 3 )<br />
y--;<br />
if( dir == 4 )<br />
x--;<br />
}<br />
<br />
public void move()<br />
{<br />
<br />
}<br />
}<br />
}
|
|
|
|
|
What do you percieve to be wrong ? If it doesn't compile, what line is the problem and what's the error ? If it does, then what is failing to happen, and what code is not doing what you'd hoped ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It compiles but it is something with the "Being" class not being able to manipulate the "world" variable even though the permissions is set correctly. so I have no clue and since this is my first time manipulating graphics I'm not even sure if I'm initializing an instance of Being correctly.
|
|
|
|
|
I don't see which part of Being relates to graphics ?
You should not use get/setpixel in a game - too slow. The paint event is the right place to draw, Invalidate() is what you need to call to force a paint event. Beyond that, I'm not sure what you're hoping for, or what is wrong. What makes you think that 'world' can't manipulate 'being', if it tries to and it compiles, then it is, it's just not doing what you hope.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
what I'm hoping for is that each instance of Being will manipulate variable g (which is of type Graphics) to change where they are currently located on the screen. Unfortunately when I try to do a g.FillRectange( new SolidBrush( Color.Lime), 5, 5, 13, 13 ); for instance it won't add the rectangle to the screen. However if I do it in the OnPaint method with the exact same code it works. I'm also not trying to have the "world" manipulate "being." I'm trying to have "being" manipulate the "world" or in this case, now, the "g" which is the graphics on screen.
Everything compiles perfectly by the way. I hope that makes sense.
|
|
|
|
|
g = Graphics.FromImage( world ); will allow you to draw on the image held in 'world'. It will not display anything you draw there on the screen. The graphics object passed into a paint event cannot be stored for use later, and it's the only way to draw to the screen, except CreateGraphics, and that is a bad idea, as what you draw will be lost if the form is invalidated.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
so if I want to create the graphics for each "being" I'll need to manipulate them in the Paint event and not in the "Being" class? So instead of calling a g.FillRectangle( yada yada ) in the "Being" class i'll have to do that in the Paint event and use variables from a particular instance of "Being" to manipulate the graphics?
|
|
|
|
|
A common solution is to add code in your class which takes a graphics object, so you can iterate over your objects and have them draw themselves, in a paint event.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sweet it seems to have worked! Thanks buddy. Now to figure out how to read a specific graphic pixel ha.
|
|
|
|
|
If you check out my image processing articles, they show the alternative way to access pixel data.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Bitmap bm = new Bitmap(@"c:\Hamtaro.jpg");
Graphics gr = Graphics.FromImage(bm);
gr.DrawString("Hello Graphics", new Font("Verdana", 10),
new SolidBrush(Color.Tomato), 1, 40);
What seems to be the problem
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
You don't clean up any resources ? You create a new brush instead of using the built in Brushes collection ?
What makes you think there is a problem ? I don't see any code that would display the bitmap with the text on it, and you're not saving it, so the original image will remain the same, only a bitmap in memory is modified.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Then how do you do it?? I even get an error on this line:
Bitmap bm = new Bitmap(@"c:\Hamtaro.jpg");
Error 1 Cannot implicitly convert type 'System.Drawing.Image' to 'System.Drawing.Bitmap'. An explicit conversion exists (are you missing a cast?)
And sorry, how do you save it eventually??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Display it in a picturebox:
pictureBox1.Image = bm;
Save it to disk:
bm.Save(@"C:\Hamtaro_with_text.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
|
|
|
|
|
I'm a c programmer trying to convert my programs to c#. Many variables are global and require extern to access them. I'm a bit confused on how global variables are used in C#. How do a declare and used then in different dll's
Brian
|
|
|
|