|
cool...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
hi iam in a little bit of confusion how to add webreferences dynamically in .net can anybody helps me
|
|
|
|
|
If you add a web reference allready in your application then set its property to Dynamic. After that Suppose on a button's click write this
Myref is the service name Ok. And client is a object of that.
Myref.MyRef client = new Myref.MyRef();
client.Url = "Web reference URL"; //put new URL here.
client.Methodname(parameters);
Hope this helps
-- modified at 3:53 Monday 12th November, 2007
Regards
Pankaj Joshi
|
|
|
|
|
How can i show all the images of a given folder and show them as long as the application is running?
I would like them to be organized by name and show in the full form...
Best regards,
Luis E Tineo S
|
|
|
|
|
like slideshow?
if yes then use Timer
Becoming Programmer...
|
|
|
|
|
|
why are you making a seperate picturebox for every picture
use only one that will be easy and good
Becoming Programmer...
|
|
|
|
|
Because i need to know what picture was choosen... to pull some data out of it!!!
Luis E Tineo S
|
|
|
|
|
so it not compulsary to make seperate pictureboxes
while loading picture, give its path or file name to a label or a string
and when picturebox clicked, you will know about the picture
Becoming Programmer...
|
|
|
|
|
the best way which i think is that storing all the images with similar sequential name like 1.jpeg,2.jpeg...
then take a pic box n a timer so in the form load function write something like this
picbox.backgroundimage = image.fromfile("c:\\" + i ".jpeg");
i = i+1;
run a timer which repeats the above function
i hope this will work as i have done it before
its me sid
|
|
|
|
|
It makes a lot of sense but how can i create the different picturebox for each pic, because even if i have the timer at 10 miliseconds it will always be the same and if i am calling a method from it, it will always call the same method?
I need to create different pictureBox because i will have a touchscreen where end users will select picture they like the most.
So to a given folder containing the pics i will give it a picture for each pic to make sure i control all pictures.
My problem is that i can be given 2 pictures but i also can be given 100 pictures...
Thanks... a lot!!
Luis E Tineo S
|
|
|
|
|
I dont have much idea but a clue i hope it works
step 1. take a pic box array
2. Count the no of pics in the folder
3. now run a loop to show the pic boxes as accordint to no of pics
4. Assign proper top n left values to the pic boxes
i hope this will be useful ...any way nice question 4m u
its me sid
|
|
|
|
|
I think I was doing that before i posted the question and i received an exception that i did not do how to correct...
//images is an array that contains all images in the given folder
images = loading.Loading();
//loading.cant() returns the number of files contained in the folder
PictureBox[] pics = new PictureBox[loading.cant()];
foreach (Image img in images)
{
//with ImagesList i can display the images but not let them be in the form until it closes
ImagesList.Images.Add(img);
}
//i added this loop to have a better control of the array of pic
for (int i = 0; i < loading.cant(); i++)
{
//both codes generates an execption can you tell me why?
//pics[i].BackgroundImage = images[i];
pics[i].BackgroundImage = ImagesList.Images[i];
pics[i].Show();
}
sindhutiwari wrote: i hope this will be useful ...any way nice question 4m u
thanks man, i really appreciate it!
Luis E Tineo S
|
|
|
|
|
Picture boxes are a waste of time. Write your own paint handler and then render as many images as are appropriate for your screen size and image size.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I like that idea a lot better but can you please point how to start my own paint handler?
I am a little rookie to describe myself in a positive way but i don't know much of images processing.
Thanks...
Luis E Tineo S
|
|
|
|
|
Handle the paint event. It's passed a graphics object. You can use the DrawImage methods on that object to draw images direct to your screen.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks... I guess that's the signal to start reading something new...
I love this project, i surely do... It has made me learn from network programming to Images processing...
I think after this i want to become a programmer!!!
Thanks again!
Luis E Tineo S
|
|
|
|
|
I didn't get it to work the way you advice me, not because it did not work that way but because my lack of knowlege, but i did get it to work like this:
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
int totalPics = loading.cant();
while (cantPictures < totalPics)
{
PictureBox P = new PictureBox();
Bitmap imag;
if(cantPictures <= 5)
{
if (cantPictures == 0)
{
imag = new Bitmap(images[cantPictures]);
P.Image = imag;
P.Click += new EventHandler(P_Click);
P.Size = new Size(150,150);
P.SizeMode = PictureBoxSizeMode.StretchImage;
P.Location = new Point(35, 10);
constante = 35 + P.Size.Width+10;
this.Controls.Add(P);
}
else
{
imag = new Bitmap(images[cantPictures]);
P.Image = imag;
P.Click += new EventHandler(P_Click);
P.Size = new Size(150, 150);
P.SizeMode = PictureBoxSizeMode.StretchImage;
P.Location = new Point( constante, 10);
constante += 10 + P.Size.Width;
this.Controls.Add(P);
}
}
Now i have a little problem adding the Click Event individually, any advice there?
Luis E Tineo S
|
|
|
|
|
|
That is soo true it does have all i need.
I am going to ask the owner to let me use some of his code if it is possible.
I like to ask for permission even if it is open.
Thanks a lot,
Best regards!!!
Luis E Tineo S
|
|
|
|
|
Erhm, not having a dev env here right now, but this should be pretty close...
<br />
DirectoryInfo diPictureFolder = new DirectoryInfo("c:\\Your\\Pics\\");<br />
foreach (FileInfo fiPic in diPictureFolder.GetFiles("*.jpg"))<br />
{<br />
PictureBox pb = new PictureBox();<br />
pb.Image = new Bitmap(fiPic.FullName);<br />
pb.Click += new Event handler for click event<br />
yourForm.Controls.Add(pb);<br />
}<br />
|
|
|
|
|
Hi Friends,
Kindly give the method, How may I set "F10" key in "MDI/Main" form to close application?
Thank you
(Riaz)
|
|
|
|
|
if (e.KeyCode == Keys.F10)
Application.exit();
But remember it will run when you are having the focus onto the MDI form.
It will not work when any child form is open.
Regards
Pankaj Joshi
|
|
|
|
|
1. Set KeyPreview to True in the properties of Main form
2. Write the following code in the Keypress event of Main Form
if(e.KeyCode == keys.F10){<br />
Application.Exit();<br />
}
Hope it helps.
|
|
|
|
|