I've got the coding below to make a screenshot and store it in a jpg file`.. this works fine on my computer with vb.net installed. However when I tried running it on an other computer it gave me this exception:
'a generic error occured in gdi'
'the coding
PHP
Dim screenImage As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenImage)
[Code]....
I've read on internet that this is a write permission issue or it has something to do with the stream. Anyway I dunno how to alter the coding so that every user can make a screenshot.
I have some code that takes a screen capture of my monitor. This code seems to work perfectly OK and can take multiple screen captures, apart from when I do a Print Screen using the keyboard or open SnagIT 8, when I then try to run my code again I get an error "A generic error occured in GDI+" I am at a bit of a loss, I have had a look on the internet, but everything I seem to find appears to be related to web apps. and access permissions. This is a window based application and therefore can not seem to find an answer.[code]
i try to save image to a folder on a server. i load the image from a fileupload control, resize it and save to the folder. this works fine when i run from Visual studio. But when i deployed to the server, i get the error: "Generic Error Occured in gdi+". In trying to solve this, i give network service and asp.net accounts permissions to the folder.
Public Function SaveEntityImage() As Boolean If fuEntity.PostedFile IsNot Nothing AndAlso fuEntity.PostedFile.FileName <> "" Then
I am trying to create bitmap with my text and transformation. I am sure that there is no error in my code. Because this code is worked previously. Here is my code.
Failed to Load Control <ControlName> from. . Your version of may be outdated. Make sure you are using the version of the control that was provided with your application."
I am making a small report for when an error occurs in our application, in that report I provide myself information of all the ids and stuff and send it to my email. What would also be very handy is to get hold of the sub of where the error has occurred, is this is possible?
I am working on VB.Net project. All was well until I started getting the following error while trying to view Forms ...
The error says : "An error occurred while parsing EntityName: Line 4 Position 42"
All code is fine not logical problems..but the came suddenly and this error in all the forms...Projects runs perfectly but I am not able to see Forms Designer...
The guy who originally developed this program is ridiculously BAD at collaborating with me on this. He is currently looking into it but he hasnt even called me back about it and this is of the most importance as today the 2012 member cards start getting printed and they wont print!
When I run the code exception happening below place.
defaultWriter = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>(); //errr: Activation error occured while trying to get instance of type LogWriter, key ""
It checks if the webpage in the web browser control has crashed. The website crashes alot. I want to acomplish this by checking the text of the webpage for vital keywords such as "ERROR" or "Could not connect:" or "An error occured. Returning to the autowatch system in 60 seconds..." The code I have so far is below.
Dim myText As String = Me.WebBrowser1.Document.Body.InnerText If myText.Trim().StartsWith("Could not connect:") Then WebBrowser1.Navigate("http://www.enhanceviews.net/view/config_check.php")[code]....
The page refreshes every 5 to 120 seconds. The timer gets activated 10 seconds into the program's launch. It refeshes the code above every 5 seconds(to minimize CPU usage). However, it crashes and gives the error "NullReferenceException was unhandled". This could be because the page keeps on refreshing or the page is php and has 2 iframes. How do I fix this?
We have migrated our Vb6 application to VB.NET using a third party tool. Now we are in a process of Refactoring and introducing object oriented concepts in the application.
In VB6, we were using structures in many places. As a part of introducing object oriented programming,
1. is it a good idea of changing all Structures to Classes? or Is there a concept of "Generic Structure" similar to Generic collections, Generic classes?
2. Can some one guide me any source containing guide lines or best practices for applications that are migrated to VB.NET from VB6 and implementing object oriented programmaing.
I have 10 year old animated GIF that works fine in an internet browser, but when I set it as an image in a picture box I get the following error: "A generic error occurred in GDI+." I attached the file. Does anyone know how I can get this image to place in my vb form? If the image needs to be modified?
I am writing a VB.NET application which captures an image from a webcam and saves it as a jpeg. I have a button which captures the image and successfully saves the image. However when I click the button again to save the image as the same file I get the following GDI error[code]....
i save the PictureBox Image to the Sql using the following code
Private Function convertPicBoxImageToByte(ByVal pbImage As Image) As Byte() Dim ms As New System.IO.MemoryStream() pbImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
I have a problem with this code. If i start the program and click on save.The program saves the picture. If i reload the picturebox and save it again i get the error :A generic error occurred in GDI+.I think the problem is that the File is being used by another process.So i think i can't rewrite the bmp file. Is it possible to release it from the process so i can write it again? [code]
My app has an image in it in a picture box. I need the end user to be able to change it. So the code I added below should do that. However, I get the "A generic error occurred in GDI+. while saving".I understand it as this- possibly an error saving it to C:?? Because when I save it to a folder such as MyPictures or Pictures it saves A-ok. [code]
We are developing an application for our shop floor. This program will be tracking material through the shop and we need to capture any errors the program generates, but we don't need to stop the program for all errors. I have some code to do a screen capture and put it in a database with exception.tostring data for debugging.
What we would like to do, is create an exception from the base class, but provide additional properties to allow us to set a severity and a user friendly error message. I would like to encapsulate this in a class that we would call in the catch of a try/catch, set the properties on the class, have the class record the data to the database, then raise the exception to the main program to display only the user friendly message and severity. The main program would then determine the severity and based on the severity stop the program or just display a discreet msg and continue to process.
Does anyone have an example of a custom exception class derived from exception that does something similar, or if I heading in the wrong direction, does anyone have a better solution?
I have a vb.net form with ToolStrip menu [code]My development environment is .net 4.0, VS2010, windows 7 x64; but occasionally I am getting next erro.[code]
I did post this in my thread about webcam but its nothing to do with webcam issues, the code for the webcam is working perfectly now I am instead now having an issue saving an image file from a picture box.
I don't mind how its done or whether its bmp/jpg (jpg would be better for te compression) but This orginally did work now I keep getting this error that I have never come across before and can't find much information on the error.Error Message:A generic error occurred in GDI+.
i just encounterd an error gdi+ when saving same image back to database.im using this code to get image from db
'Stream object containing the binary data Dim ms As MemoryStream ms = New MemoryStream(CType(Me.DataGridSearchView.SelectedCells(10).Value, Byte())) frm.Picture1 = Image.FromStream(ms) ms.Close()
frm.Picture1 is a property of image type from another class.and this my code to update image back to db
If Not Me.PictureBox1.Image Is Nothing Then Dim custPic as Byte() = Nothing Dim ms As MemoryStream = New MemoryStream
[code]....
there is no problem if i changed the image before saving it back to db,it gives error if you will not change the image before saving it back to database..
I'm trying to convert a batch of .pngs to .jpgs, as in this question:
[Code]....
The call to jpg.Save, however, with a "generic error" in GDI+. Originally outside of the innermost Using statement, I moved the call inwards as per this answer, but it didn't change anything. I have verified that newfile contains a valid path, and that the program has write access to the directory. What am I missing?
I'm writing an application which as part of it draws an image on a Logitech G15v2 keyboard's LCD. For the most part the function works fine, but after a while of running, one of the lines throws a "Generic Error in GDI+" The problem, according to a stack trace, is in Bitmap.GetHbitmap():
at System.Drawing.Bitmap.GetHbitmap(Color background) at System.Drawing.Bitmap.GetHbitmap() at CSCI171_TermProject.G15.Tick(Single Interval) in C:UsersSukasaCSCI171Term ProjectCSCI171-TermProjectG15.vb:line 45"
I've read a few threads mentioning this error, but that was in the context of saving a file, not getting its associated HBitmap. Would anyone with more experience with GDI+?For better reference, here's the full code module:
Public Module G15 Private G15 As New G15Lib.G15Interface Private G15BaseImage As New Bitmap("GFXG15-BGImg.png") Private G15Minimap As New Bitmap(43, 43, Imaging.PixelFormat.Format32bppArgb)
I have a problem with the VB.NET compiler failing to compile a class (in a separate C# assembly) which contains two overloads of a method with generic arguments. The equivalent code in C# compiles against the same assembly with no errors. Here are the two method signatures:
protected void SetValue<T>(T newValue, ref T oldValue) protected void SetValue<T>(T? newValue, ref T? oldValue) where T : struct
Here is the code to three assemblies that demonstrate the problem. The first is the C# assembly with a Base class that implements the generic methods. The second is a C# class derived from Base and calls both overloads of SetValue correctly. The third is a VB class also derived from Base, but fails to compile with the following error message:
[Code]...
Am I doing something wrong in the VB code, or are C# & VB different when it comes to generic overload resolution? If I make the method arguments in Base non-generic then everything compiles correctly, but then I have to implement SetValue for every type that I wish to support.
Does anyone know what on earth this is? i can't get it to go away.model {"The generic type 'System.Web.Mvc.ViewUserControl`1' was used with the wrong number of generic arguments in assembly 'System.Web.Mvc...it happens when i call a newly constructed model that i pass to a partial view, and try using/calling some methods of it in the view.
I'm trying to import an HBITMAP created in an external dll. The dll is written in C++. What happens is that I get a non-null handle returned from the dll, but when converting to Image using FromHBitmap I get an unhandled exception as shown in the thread title.
I reduced the failure down to a barebones example. Here is the core part of the exporthbm.dll:
Scroll to the bottom, EDIT 19 onwards. See @Chris's comments also for good examples
[code]...
It's all gone quiet since Edit 19ish and @Chris reinforcing the issue with a good example (thank you Chris). I'll make the question a little easier (and attempt to tidy up all of the above), can anyone prove this is not an MS bug or similar? It seems to be something under the hood is not correctly wired up for VB.Net with regards to Nullable Structures and Events? However, all other cases using the Nullable Structures does appear to work?