|
hehe...and also a configuration file to set some properties like setting chanel,namespace and...
Mazy
No sig. available now.
|
|
|
|
|
How to load an image from a url into a PictureBox.
Thank's
|
|
|
|
|
You have to save it as a Bitmap,then set the Image property of PictureBox to it.Something like this:
picturebox.Image = Bitmap.FromFile(urlpath);
Mazy
No sig. available now.
|
|
|
|
|
Damn.. yours is much nicer than what I posted!
-------------------------------
Joan
MomComputerGeek.com
|
|
|
|
|
Mazy
No sig. available now.
|
|
|
|
|
<br />
<br />
string sURL="www.MomComputerGeek.com";<br />
System.Web.HttpRequest objRequest = new HttpRequest("",sURL,""); <br />
Stream objStream = objRequest.InputStream;<br />
PictureBox1.Image.FromStream(objStream);<br />
<br />
-------------------------------
Joan
MomComputerGeek.com
|
|
|
|
|
Thank you for the Code, it's right BUT I'm not using ASP.NET I'm using Windows Forms and the class System.Web.HttpRequest is not valid.
Do yuo know how in Windows Forms (Windows Application).
|
|
|
|
|
Josep Restoy wrote:
class System.Web.HttpRequest is not valid
I think you would just need to reference the System.Web library.
-------------------------------
Joan
MomComputerGeek.com
|
|
|
|
|
I find this code:
string sURL="http://localhost:8080/cercalia/img/dispositius_home.gif";
System.Net.WebClient RequestURI = new System.Net.WebClient();
System.IO.Stream objStream = RequestURI.OpenRead(sURL);
pictureBox1.Image = Bitmap.FromStream(objStream);
This Code Works OK.
Thank you for all.
|
|
|
|
|
After a long time I'm thinking to deal with programming again.
I want to write a math application(many graphics) with incredible many calculations in a little time so I must manipulate numbers(integer and real) as fast as possible.
I remember in "TURBO C" and old processors for fastest access(about two times faster) to integer numbers they should be declared as register and no more than two names otherwise the rest would be ignored.
In nowdays what about in "C#" and huge L2 cache memory of powerfull processors?
Has this capability to do with L2 cache?
I mean can I use L2 cache exclusively for frequently used variable names?
|
|
|
|
|
>I want to write a math program with incredible many calculations in a little time so I must manipulate numbers(integer and real) as fast as possible.
Use FORTRAN.
Seriously, if you want to write an app that does serious number crunching, maybe you'll save some development time by targeting a language that was designed and built to do serious number crunching. C# and .NET were designed to implement business applications. That's not to say they couldn't be used for math-type apps, but managed code doesn't lend itself very well to doing intensive work like that.
Also, if you want to write this app in C# (or any other language for that matter), I would just write the app in the simplest, most obvious way possible. Don't worry about performance right off the bat. Only when you have a working app do you worry about how quickly it runs: time it, profile it, and optimize it then. Trying to tune an application that isn't written yet is an exercise in building castles in the air.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
Dear Julian,
I don’t like FORTRAN and I don’t need the solutions to complex math problems that FORTRAN provides.
On the contrary I like C# and I need the speed of executing code and support in graphics mode that C# provides.
My calculations are plain operations but many as many are accesses to data that I have placed in memory. That’s why I want to know if I can access L2 cache memory directly placing there data I use more often.
|
|
|
|
|
Demokritos wrote:
want to know if I can access L2 cache memory directly placing there data I use more often
Perhaps the best is to write a little C lib to handle the crunching, and provide an interface via MC++.
leppie::AllocCPArticle("Zee blog");
|
|
|
|
|
Demokritos wrote:
Dear Julian,
I don’t like FORTRAN and I don’t need the solutions to complex math problems that FORTRAN provides.
On the contrary I like C# and I need the speed of executing code and support in graphics mode that C# provides.
My calculations are plain operations but many as many are accesses to data that I have placed in memory. That’s why I want to know if I can access L2 cache memory directly placing there data I use more often.
Graphics number crunching?
Why not use managed C++ with a directx view embedded. Id your doing 3D representations then it can handle it even better. Although, it make take to long to adapt writing to a buffer and not an actual coordinate. Either way as far as grphics go a directx port would be much faster than GDI+. But embedding directx inside a c# is like putting your car in neutral and trying to race.
If its speed you want go to c++, if its faster coding stay in c# and I would stay away from unsafe code. Its asking for trouble.
My thoughts and opinions do not in any way reflect what I just typed.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
All right:
- No, you can't access the L2 cache directly. Instead you make sure that your data structures exhibit locality of reference, both in space and time, so try not to use linked lists, or trees, or hash tables, etc. Use arraya.
- I meant what I said: write your code in the simplest, most obvious way possible. Then, and only then, when it's all working and tested, profile it. Find out where your major performance problems lay (if you have any major ones). Then start refactoring with using struct instead of class, creating temp variables, using unchecked or unsafe or both, etc.
- To do the previous part, make sure that you have proper unit tests set up beforehand. Comment changes you make for performance reasons, especially if they're not obvious.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
I try to flip metafile ,but I recive this kind of exception:
An unhandled exception of type 'System.NotImplementedException' occurred in system.drawing.dll
Additional information: Not implemented.
|
|
|
|
|
Hi there,
I really hope someone can help me with this one. Here's my problem:
I'm wrapping the RAS api in C#for the compact framework. Everything works fine except for one thing: setting and getting the RASDIALPARAMS structure for a certain entry.
Since the CF does not support enough Marshalling features, I have a byte array that represents the RASDIALPARAMS struct initialized as follws:
DIALPARAMS = new byte[1462];<br />
DIALPARAMS[0] = 0xB6;<br />
DIALPARAMS[1] = 5;<br />
Encoding.Unicode.GetBytes(Name, 0, Name.Length, DIALPARAMS, 4);
I've ued the same technique for other structs and have no problem at all. With this one though, the following API call always returns invalid parameter:
<br />
uint ret = RasGetEntryDialParams(null, re.DIALPARAMS, ref pw);<br />
What is really weird: When I use my struct with the RasDial function it seems to work: the function returns a valid connection handle and the ppc device starts sending AT commands over the serial line.
Has someone got an idea on what's wrong here?
Many thanks in advance,
G
"D'Oh!" (Homer J. Simpson)
|
|
|
|
|
|
Sorry maybe I wasn't clear enough on the fact that I'm using the Compact Framework (CF) on WinCE were there is no such thing as a ras book. Everything is stored in the registry and on WinCE it's all Unicode.
My approach works fine for all structs and API calls exept for the Set- and GetRasEntryDialParams...
G
|
|
|
|
|
|
Don't know if anyone is interested in readin this, but I found the problem myself.
I did not realize that C structs are aligned to be a multiple of 4 bytes (32 bits, of course).
That's why I have to use 1464 in stead of 1462 bytes for my array.
Pretty stupid isn't it!
Gino
"D'Oh!" (Homer J. Simpson)
|
|
|
|
|
Hi.
I have a datagrid on my form that has the datasource set to a datatable in a class in different project but same solution. When I change the data in the datatable, the datagrid is very long to get the changes (~2 seconds) which is not great. I use a bit complicated architechture, but it should not matter. Here's roughly what i do:
_____
ClassState:
DataTable MyData = new DataTable();
(Fill in dummy data)
_____
ClassForm:
MyGrid.DataSource = ClassState.MyData;
ClassEvents.MyGetData();
_____ -->
ClassEvents:
DataTable temp = MyWebService.GetData();
classState.MyData.BeginLoadData();
Foreach(datarow dr in temp)
{
classState.MyData.ImportRow(dr);
}
classState.MyData.EndLoadData();
//From here and until the datagrid is updated it takes ~2 seconds. WHY??
____________
I timed and logged every line in my code and found out that it is the datagrid that i slow on getting the updates (or the datatable that is slow sending update notifications). It has nothing to do with getting data from the webservice.
Is there some way to tell the datatable to send notifications NOW??
Or could it have something to do with the fact that ClassState, ClassForm and Class events each is in it's own project (but same solution)?
Or do you have any other ideas?
|
|
|
|
|
We can show the text with DrawString,but I cannot get width & height of the text,though I need them.
Can you help me?Thanks
Future belongs to C#!
|
|
|
|
|
use the Graphics.MeasureString method.
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|