|
No problem
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
how can can i load an image from a file in to a picture box in mobile application (not using filedialog)
when the page loads it must display the picture
This code was posted by me...
|
|
|
|
|
Well you can use...
PictureBox1.Image = Image.FromFile("filepath");
But you will probably bump into file access issues at some point so use the following...
FileStream fs = new FileStream("filepath", FileMode.Open, FileAccess.Read);
PictureBox1.Image = Image.FromStream(fs);
fs.Close();
That should do the trick for you
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
both fromfile and fromstream are not available in mobile application
This code was posted by me...
|
|
|
|
|
well you didn't say anything about that in your original post. - Hmmmm... was that there before? My bad if it was
Are you using the compact .Net Framework? Here's[^] one of many links on a google search
P.S There is a forum dedicated to 'Mobile Development'
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
byte[] data = new byte[1024];
data=receivefile();
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
try
{
FileStream fs = new FileStream("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Create);
ms.WriteTo(fs);
ms.Flush();
fs.Close();
ms.Close();
i m getting "exception in this code"
pictureBox1.Image = new Bitmap("\\Program Files\\pic\\screen.Bmp");
}
i getting "Exception" int he last line
it is not telling what is the exception just Exception
This code was posted by me...
|
|
|
|
|
well first thing I see is that the two file paths are not the same, if that not the problem can you confirm that a Bitmap is successfully created opening it manually?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thats not a matter when debuggin i copy the image from
\\Program Files\\syswifi\\pic\\screen.Bmp
to
\\Program Files\\pic\\screen.Bmp
This code was posted by me...
|
|
|
|
|
you say you don't get an error message. is that because you are handling the catch yourself? either add a messages box showing the exceptions message. Or remove the try catch and let the system give you an error message. maybe that will help
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
the exception is caught in the line
picturebox.image=new bitmap(fs)
where fs is filestream
This code was posted by me...
|
|
|
|
|
NullReferenceException is caught in that line
This code was posted by me...
|
|
|
|
|
well if you add a break what object is null? The PictureBox? The Image? or the Bitmap?
Can you put in code to verify the file exists...
if(File.exists("filepath"))
//show message
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i don knwo wht is happening,The file is created. that i can see when when i browse the folder. but null reference exception is shown when i run applcn.
here is the code
FileStream fs = File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Create);
ms.WriteTo(fs);
ms.Flush();
fs.Close();
ms.Close();
FileStream fstr = File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Open);
pictureBox1.Image = new Bitmap(fstr);
This code was posted by me...
|
|
|
|
|
What is it that is null thou?
OK what i suggest is you put a breakpoint after each line of code and check the status of each variable (also check the new bitmap once the first filestream has been closed)
you can also use a message box in each line and the pause the application for each one if you prefer.
Hopefully then you can confirm what value it is that is null and get somewhere from there
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
it worked...thanx
This code was posted by me...
|
|
|
|
|
Hello Experts!!
I am creating treeview at runtime also added node to treeview successfully but i dont know how to add child node to respective same node.
Help!!
|
|
|
|
|
|
I would assume you added the first node with...
TreeView1.Nodes.Add("a node");
Well, each node also has a collection of nodes so if you store the return value of the above method, or obtain the node with another method search as find then you can add nodes to the collection like...
TreeNode baseNode = TreeView1.Nodes.Add("Something");
baseNode.Nodes.Add("My First Child Node");
Hope that helps
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
hi
String domainAndUsername = domain + @"\" + username;
the above line is creating an exception looks pretty ok to me
domain and username are passed through the arguments in this function they are returning it well though
is concatenation a problem if done through this way
|
|
|
|
|
rhcp08 wrote: the above line is creating an exception looks pretty ok to me
English laguage has something called comma and full stop. It makes life easy to understand.
In between, what exception message are you getting? Would you explain in detail?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
What exception are you getting? Do you have a null string by any chance?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi
i have created a database by importing data from MS EXCEL in SQL server studio managemnt. but i am not locate on the disk .
when i tried to create database in the VISUAL studio 2005 by
Add New Item->SQLDATABASE
but it gives me an error that connection SQL SERVER 2005 requires it work properly. it is to be noted that i am in a professional company where all the software are installed and authenticated by professionals. where is the error?
1. first of all where the hell database is stored after creation in studio manager
2. how to connect my database with or without excat location of the database
(i can connect it if i know the location)
|
|
|
|
|
rhcp08 wrote: 1. first of all where the hell database is stored after creation in studio manager
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
rhcp08 wrote: 2. how to connect my database with or without excat location of the database
(i can connect it if i know the location)
With SQL Server, one connects to an alias on the server. This alias is mapped to a physical file. You can connect once you know the location of the server and the name of the database.
I are troll
|
|
|
|
|
Further to Eddy's comments. If you absolutely must know the location of the database:
In studio manager, select your database, right click on it and select properties from the context menu.
In the dialog that appears, select 'Files' from the left hand pane, then in the right pane scroll across to the Path column.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
rhcp08 wrote: it is to be noted that i am in a professional company where all the software are installed and authenticated by professionals.
Professional just means they get paid to do it. It does not mean they are any good. I've met many "professionals" that I would be surprised if they managed to find the "On" switch.
rhcp08 wrote: first of all where the hell database is stored after creation in studio manager
It gets created where ever you tell it to create it. If you don't there will be a default location depending on how it has been installed.
rhcp08 wrote: how to connect my database with or without excat location of the database
You should neither know nor should care where the database is physically stored as it can be stored in many different ways. You can store it in a file on the Hard Disk. You can split the database in to many files. You can store the database across disks. You can hand over entire hard disks to SQL Server and let SQL Server manage the entire disk (no file, just a disk).
You connect to a database, not a file (Except for SQL Server Express edition, which can treat a database as a file)
|
|
|
|