You need to attach a test case or I won’t be able to tell you what’s wrong in the code. I cannot reproduce the issue you describe (IIS or IIS Express) since it’s related to the wrong usage of Image.FromFile or FromStream.
Dear Luca,
I have just find that if I using IIS express to debug then everything fine.
But when I publishing to IIS server that have problem that have only 2 client session can be working, even my web site is nothing (no load any picture). If I open more tabs, example 10 tabs, then the tab from 3 to 10 to be hang. Until I close tab 2nd then all tabs which be hang will auto loading again!
I have trying to push other web site (not build by Wisej) to IIS server on my laptop, that working fine with more clients (IIS server version 10.0.17763.1 on Windows 10 64bits home edition)
May be have problem about connection between IIS server and web server was. Do you have any experience about publishing to IIS?
Thanks!
The correct way to use Image.FromFile or FromStream with System.Drawing is like this:
using (var image = Image.FromFile(file))
{
return new Bitmap(image);
}
The using keyword will dispose the image when the block is exited. It’s similar to try/finally.
The new Bitmap() line causes the full reading/decoding of the file or the stream.
If you want to use the file directly simply assign it to pictureBox1.ImageSource.
If you still have problems using the images please attach a test case showing the issue and the code you are using.
Cristian,
You can set the visibility of the scrollbar by using something like:
flowLayoutPanel1.ScrollBars = ScrollBars.None;
There is also a “VScrollBar” component that is more similar to the behavior you are desiring and could be used to scroll controls.
I’ll see what I can do about adding a request for the scrollbars in controls to by default have the “Maximum” property.
Best regards,
Levie
P.S. There will be a Wisej 2.1 release this year – we’ll post an update about this soon.
Support for Linux and .NET 5 is currently planned for 2020 with Wisej 3.
Hi Werner,
Here is a tutorial from Microsoft on how to add sign-in for your asp.net application:
https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-asp-webapp
https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-aspnet-webapp
Is this what you’re looking for?
Let me know!
Best,
Levie
Hi Eyal,
Thanks for reporting. The responsive event is not working in 2.0.34 and causing a few issues, but will be fixed in the next release.
Stay tuned!
Levie
Dear Luca,
You just sent me good information!
I understand of your attention.
I’ve creating the test case as below:
stream = New FileStream(“c:\DM_DC_MB.jpg”, FileMode.Open, FileAccess.Read)
PictureBox1.Image = Image.FromStream(stream)
stream = New FileStream(“c:\DM_DC_MB.jpg”, FileMode.Open, FileAccess.Read)
PictureBox1.Image = Image.FromStream(stream)
stream.Close() // or stream.Dispose
stream = New FileStream(“c:\DM_DC_MB.jpg”, FileMode.Open, FileAccess.Read)
PictureBox1.Image = Image.FromStream(stream)
In another button, I’m using: stream.Close(). After that I can change DM_DC_MB.jpg filename => successful to unlock file.
I have one question that how to use PictureBox1.ImageSource with local file? I have testing some local path file but it can’t load image.
Thank you so much!
With the way the ChartJS implementation works, you’ll need to add a little bit of logic, for example:
Private Function FillDataSet(current As Integer, max As Integer) As Object() Dim maxLeftOver As Integer = max - current Return New Object() {current, maxLeftOver} End Function
You can play around with it to get your desired functionality.
Use it like:
pieDataSet1.Data = FillDataSet(1,5)
You should also check out the “JustGage” component, this might be more suited for what you want to accomplish! You can integrate any third-party JavaScript library you like to fill the chart if either of these don’t work.
Let me know if this works!
Thanks Levie,
Almost it 😉
how to give the chart the value of 100, and make it fill for example 74 ?
System.Drawing.Image.FromFile locks the file and keeps it locked. It’s not a Wisej issue, it’s the way System.Drawing works.
There are several ways to load an image from a file e release the lock:
https://stackoverflow.com/questions/6576341/open-image-from-file-then-release-lock
Additionally with Wisej you don’t need to use Image.FromFile since you can assign the file to ImageSource.
If you use Image.FromStream you will get the same problem since the stream is kept open. That’s the way it works. You have to load the image and release the file or the stream.
Dear Luca,
I create a simple project:
I’m testing:
Thanks!
Thanks Cristian,
I’ve logged the issue! I’ll let you know what we find!
Hi Eyal,
This is a known issue and will be fixed in the next release. Sorry for any inconvenience. We’ll keep you updated when it’s available!
Best regards,
Levie
Hi Jorge,
Please let me know if this sample works for you!
Best,
Levie
Looks like your code is locking when using SQL Server. Send a small test case without using SQL server showing the issue please. I tried with a file, with a theme image, with a URL and it always works well.
Thanks Cristian,
Logged as issue #1945.
I’ll keep you updated on the status!
Hi Leive,
only with anchor, see project attached
Does this issue still occur when anchoring is set to none on the textbox?
Hi Cristian,
Thanks for reporting the issue. It’s logged as #1944.
Best,
Levie
