All Answers

0 votes

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.

  • Luca answered Aug 3, 2019 - 5:04 pm
0 votes

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!

0 votes

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.

 

  • Luca answered Aug 3, 2019 - 3:10 pm
0 votes

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

0 votes

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.

0 votes

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

  • Levie (ITG) answered Aug 2, 2019 - 6:44 pm
  • last active Aug 2, 2019 - 6:47 pm
0 votes

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

0 votes

Dear Luca,

You just sent me good information!

I understand of your attention.

I’ve creating the test case as below: 

  • As your notification, if I don’t release stream, the file will being lock. Yes, I can test by change the file name after command loading image. The system will say to me that “The action can’t be completed because the file is open in IIS  worker process” as image attachment.

stream = New FileStream(“c:\DM_DC_MB.jpg”, FileMode.Open, FileAccess.Read)
PictureBox1.Image = Image.FromStream(stream)

  •  If I immediately release after set PictureBox1.Image, then the image can’t display on PictureBox1:

stream = New FileStream(“c:\DM_DC_MB.jpg”, FileMode.Open, FileAccess.Read)
PictureBox1.Image = Image.FromStream(stream)
stream.Close() // or  stream.Dispose

  • If I delay release after set PictureBox1.Image, when it completed load and display image (when I seen picture), the file will being release:

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.

  • But, even the file completed unlock, It still have a problem: 3rd chrome tab to be hang after 1st & 2nd tab successful loading image… => Lock file doesn’t seem to be an error

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!

0 votes

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!

  • Levie (ITG) answered Aug 2, 2019 - 5:48 pm
  • last active Aug 2, 2019 - 5:53 pm
0 votes

Thanks  Levie,

Almost it 😉

how to give the chart the value of 100, and make it fill for example 74 ?

0 votes

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.

  • Luca answered Aug 2, 2019 - 4:38 pm
0 votes

Dear Luca,

I create a simple project:

  • Imports System.Drawing
  • Add one Picturebox1 and 2 Buttons: btLoad with code PictureBox1.Image = Image.FromFile(“C:\web4\WisejWebPageApplication4\DM_DC_MB.jpg”) and btClear with code PictureBox1.Image = Nothing.

I’m testing:

  • Publish to IIS that localhost:99
  • Open chrome 1st tab: Load image ok!
  • Open chrome 2nd tab: Load image ok!
  • Open chrome 3rd tab: Load image error!
  • Close 2nd tab: => 3rd tab automatic load image!
  • Open 4th tab: Load image error!
  • Close 3rd tab: > 4th tab automatic load image!

Thanks!

0 votes

Thanks Cristian,

I’ve logged the issue! I’ll let you know what we find!

 

0 votes

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

0 votes

Hi Jorge,

Please let me know if this sample works for you!

Best,

Levie

0 votes

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.

  • Luca answered Aug 2, 2019 - 3:36 pm
0 votes

Thanks Cristian,

Logged as issue #1945.

I’ll keep you updated on the status!

0 votes

Hi Leive,
only with anchor, see project attached

0 votes

Does this issue still occur when anchoring is set to none on the textbox?

0 votes

Hi Cristian,

Thanks for reporting the issue.  It’s logged as #1944.

Best,

Levie

  • Levie (ITG) answered Aug 1, 2019 - 3:38 pm
  • last active Aug 1, 2019 - 3:39 pm
Showing 5641 - 5660 of 11k results