|
I'd check that sure AppName.vshost.exe isn't still running in Task Manager.
|
|
|
|
|
try a filestream. Something like this:
oFileStream = ne FileStream(FilePath, FileMode.Open);
oImage1 = oImage.FromStream(oFileStream);
oFileStream.Close();
oFileStream = null;
|
|
|
|
|
This seems to have fixed it. I was doing Image.FromFile(filename) which appears to lock filename as long as the image is around somewhere.
Thanks
Brent
|
|
|
|
|
Yes, this is a known issue. I tend to wrap image loading into a class ( which I need to do often as I am also reading non supported formats ) and I will read the image, copy it to a new image, and Dispose of the one I loaded, to get around this issue.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
better yet:
oFileStream = new FileStream(FilePath, FileMode.Open, FileAccess.Read);
Luc Pattyn
|
|
|
|
|
Hi,
I added a web reference and I wanted to dynamically get the link. So I thought to store it in the app.config as shown below. When I tried to read it from the below shown C# code it returns a null value.
app.config
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key ="ABC" value ="http://localhost:9080/abc/services/abcWs"/>
</appSettings>
C# code
string WsUrl = ConfigurationManager.AppSettings["ABC"].ToString();
Does anybody know how to fix it?
Any help would be great!
Rgds,
Sampathg
|
|
|
|
|
I think that if you are writing a Web Services you need a Web.config not App.Config. Try to rename the file to Web.config
Davide
|
|
|
|
|
Davide,
First of all thanks a lot for helping..
I tried that too. But the result is the same.
Any other suggestions?
Rgds,
Sampath
|
|
|
|
|
I have created an application that displays images and I want to add the possibility to delete files directly from the app. To have the file not deleted from the system directly but have it moved to the trash bin, I utilized the ShellAPI (SHFileOperation).
So far, the implementation should be okay: when I try delete an "small" file (~200k) I am asked if I really want to delete this file and after confirmation it has moved to the trash bin.
However, "large" files (~4MB) cannot be deleted but I get the Windows error message: "The file cannot be read from the file system" (something like that).
I am pretty puzzled, since I have no clue why my implementation works for small files but not for large ones.
Any ideas???
|
|
|
|
|
Is the recycle bin set to not accept files larger than a certain size?
|
|
|
|
|
Hi everyone,
I have been looking for sometime now for the different methods for capturing a live stream webcam image from a webcam and displaying it on a webpage. I have heard somewhere that ASP can be used to incorperate the Visual C# code onto the page. Please can someone help me with this.
Kind Regards
Teeman
|
|
|
|
|
ASP and C# have nothing to do with each other . ASP.NET uses C#, and you can put C# code in your page, but it will still run on the server. You can write a .NET control and host it in a page, that would mean that your users needs to allow it, and install the framework.
The pages I saw when webcams were first the rage ( Wow - a street corner in Hollywood !!! ), would just use javascript to update the page every few seconds. If you want a live stream, then you're going to need to embed a control, I would expect.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hello All:
I've create a simple project using c#.net off Visual Studio.
I would like to deploy this project so the user can install this application on another machine.
Could anyone please point me to the right direction?? Thanks
|
|
|
|
|
|
FILE -> NEW -> New Project -> Setup and Deployment Projects
|
|
|
|
|
|
|
Hi guys,
I havent done image related stuff in C# as yet but i need to ask a small question. I have stored an image in my database (SQL Server 2000). The image field in the database has a datatype of image. Now, I want to retrieve the image and display it in a image box How do i do that? I have found this code but how do I modify it to show the image in a Imagebox?
<br />
MemoryStream stream = new MemoryStream ();<br />
SqlConnection connection = new <br />
SqlConnection (@"server=INDIA\INDIA;database=iSense;uid=sa;pwd=india");<br />
try<br />
{<br />
connection.Open ();<br />
SqlCommand command = new <br />
SqlCommand ("select Picture from Image", connection);<br />
byte[] image = (byte[]) command.ExecuteScalar (); <br />
stream.Write (image, 0, image.Length);<br />
Bitmap bitmap = new Bitmap (stream);<br />
Response.ContentType = "image/gif";<br />
bitmap.Save (Response.OutputStream, ImageFormat.Gif);<br />
} <br />
finally<br />
{<br />
connection.Close ();<br />
stream.Close ();<br />
}
|
|
|
|
|
Once you've read the image in as a byte[] (as you showed in your code snippet), write it to a stream, then create an image from that stream:
byte[] imageBytes = ...
MemoryStream stream = new MemoryStream(imageBytes);
Image image = Image.FromStream(stream);
stream.dispose();
|
|
|
|
|
umm..There might be a slight problem and I might even have posted in the wrong forum (my bad). Its a web application in c#. Its and Image control
|
|
|
|
|
I'm a vb programmer but i have to make a control in C# to be consumed by a vb .net application. I've found some help on the internet/newsgroups in order to scan an image from a twain source and send the image to the software. I've tested the program and it works fine, but now i'm using that code on a usercontrol in order to consume that usercontrol in vb .net application. Everything works fine (the scanner driver can be selected, the driver interface is shown and the user can interact with it,...), but the image cant be digitalized, for what seems to be caused by this line that i had to comment in order for the usercontrol to be builded
Application.AddMessageFilter(this);
When i insert the previous line, i get the following two errors:
1- "the best overloaded method match for 'System.Windows.Forms.Application.AddMessageFilter' (System.Windows.Forms.IMessageFilter)' has some invalid arguments
2- Argument '1': cannot convert from 'TwainMCtrl.UserControl1' to 'System.Windows.Forms.IMessageFilter'
Does anyone knows how can i solve this problem?
My thanks in advanced
Ricardo Furtado
|
|
|
|
|
The error message means that UserControl1 is not implementing the IMessageFilter interface. Is that what you intend to do?
|
|
|
|
|
I need to write a tool to present webpages on a screen in a showcase.
Therefor I use the webbrowser class in fullscreen. So long so good.
A problem occurs, when the presented webpage is longer than the screen. Then I want the software to SCROLL AUTOMATICALLY (by code) down and up slowly.
My idea to do that was to access the scrollbar. But how do I access it? How do I get a handle to it?
I am thankful for any suggestions howto realizethe automatic scrolling.
-- modified at 8:38 Saturday 27th January, 2007
|
|
|
|
|
I have written an application which interacts with the oracle database. There are 2-3 update queries in my program. There is only 1 select statement which executes at the start of the program. The problem with my program is I call the Update queries from a recursive method. I have noticed that the memory consumed by my program keeps increasing and occasionally decreases.
But If i minimize the application. The memory used drops down from 44k to a 7-8k and if i maximize it it starts increasing again. I believe that it is a Garbage collection problem.
Can any one help me how to force garbage collection to happen each time method returns
cheers....
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
You can force garbage collection by calling GC.Collect(), but if the most your application is taking in memory is 44k, I'm not seeing the problem.
|
|
|
|