|
hi
please tel me how can i use a class or library or code for changing the contrast and sharpness of an image?
warm regards
|
|
|
|
|
You'll either have to use a third party image manipulation library or write one yourself in C# or C++. VB.NET can do it, but doesn't support pointers, so it's very slow at it.
Search the articles for "Image Processing for Dummies" for some examples by Christian Graus.
|
|
|
|
|
There's a VB.NET sample program called 'Fotovision', from Microsoft. It shows how to do contrast using built in GDI+ stuff. I've not seen an approach for sharpness that doesn't involve using C#, as per my articles ( thanks for the plug, Dave :P )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi
i have a form with three numericupdown control and two text box and i bound that controls to a sql data source with a table adapter, how can i change and update the values of that controls in data base?
warm regards
|
|
|
|
|
Call the EndEdit method on your BindingSource object then call the Update method on your TableAdapter.
|
|
|
|
|
thank you for reply but
i use this method but there is some thing wrong and and error code has been generated when i use it the error is : update requires a valid update command when passed datarow collection with modified rows.
where the problem?
|
|
|
|
|
There are three common causes of this problem.
Either the TableAdapter was configured to use a stored procedure in your database, or the adapters GenerateDBDirectMethods property is set to False , or the table doesn't have a primary key uniquely identifying each row in the table.
If your SQL for the adapter is merely using the results of a stored procedure, you'll have to change the TableAdpater and give it the SQL commands (UPDATE, INSERT, DELETE) to use to update each row in the database from the changes in your datatable/dataset.
Fixing the GenerateDbDirectMethods problem is easy. All you have to do is change the checkbox in the Dataset Designer and resave the dataset to recreate the TableAdapter.
If your database table doesn't have a primary key, you'll have to add one to use the TableAdapter.
|
|
|
|
|
I need to write a script that will run every time someone tries to log off or shutdown a computer. In the past people have logged off computers while QE testing or automation on virtual machines were running. So it would always be a real pain when these VMs were shut off without warning. I need to write a script that would check for VMware’s executable file (vmware-vmx.exe) and (if the process is found) prompt a warning to the user and stop them from shutting down or logging off.
I’ve done A LOT of research on the internet about logoff/shutdown scripts, posted on message boards and I’ve emailed people that I know. However, I haven't been able to find any examples. I’ve found three different API calls/messages and I really don’t know which one I should use. I can’t move forward with my scripts until I do:
AbortSystemShutdown - This call aborts a shutdown initiated by InitiateSystemSutdown or InitiateSystemShutdownEx calls. ASS is thrown during the timeout period specified by ISS or ISSE. I don’t know if it will work for the console session since ISS and ISSE are only used in RDP connections.
ExitWindowsEx - Can shutdown, logoff, or restart a computer and pass reasons to the event log as to why any of these happened. I havn't found an API that aborts this call. I know that EWE sends the WM_QUERYENDSESSION message which can potentially abort a logoff/shutdown if the a value of “0” is returned. How do I respond to this message with “0”? I haven’t found any examples.
SystemEvents.SessionEnding - Can cancel shutdown
My qualms: can’t cancel logoff and too many caveats: console apps don’t raise this event, cancel only works sometimes, and there’s no guarantee this event will fire before the closing event fires.
I would really appreciate some help and feedback.
P.S. Just in case your wondering, I’m aware of the fact that I can’t directly call an API from a script and that I have to use either MS Office as proxy to load the code into a macro to make the calls or use an ActiveX control to act as a wrapper to make the calls
|
|
|
|
|
This isn't going to be a very helpful answer, I'm afraid, but if the VMs need to be running independently of the user, and can be interrupted by a user logging off or shutting down his machine, why are they being run on the user's machine at all? Stick a copy of VMWare server (free) on a server in the corner of the room somewhere and make everyone RDP to the machine. Set the RDP policies to disallow people shutting down the box, and job done.
|
|
|
|
|
Though Craster's solution is the way it should actually be, if you don't/can't/won't do it that way you can use the System.Diagnostics.Process namespace and search for that process and see if it's running in the task manager, if it's found then warn the user, such as:
Public Function IsProcessRunning(ByVal sProcessName As String) As Boolean
For Each clsProcess As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses
If clsProcess.ProcessName.Contains(sProcessName) Then
Return True
Else
Return False
End If
Next
End Function
Then you can call it like this:
If IsProcessRunning("vmware-vmx") Then 'Leave the .exe off
MessageBox.Show("VMWare is currently running. Please log off of VMWare before shutting down",,"Critical Process Running", _
MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification,False)
Else
'Else do your processing here
End If
|
|
|
|
|
Trust me, I would much rather do it Craster's way since almost all of the QE testing is done through RDP connections anyway but that's not an option. My manager wants a script and I was told by two colleagues of mine at other companies that removing the standard logoff/shutdown methods is not something I should do in a production environment.
Thank you Psycho Extreme for giving me the code but I still don't know which call I should use so I can't move forward. I've searched microsoft groups, google groups and so many scripting websites and message boards, and no one seems to know the call and/or no one seems to have attempted this before. There arn't any examples out there. I don't know how I'm going to figure this out. In the meantime I have another question for any of you out there:
Is it possible to intercept another program's WM_QUERYENDSESSION message? If I was to go this route to abort shutdown, that's what I would need to do, right? Whenever someone tried to logoff/shutdown, my script would run everytime via group policy, check for VMware's executible, and, if found, intercept VMware's WM_QUERYENDSESSION message to return "0" so that the OS wouldn't shutdown or logoff. Now that I think about it, that's actually starting to sound like something a hacker would come up with. I don't want to go there. That sounds like high level programming which I can't learn in a month (when this project is due) and I don't even think I could do that in a script.
Forget that first question. Try and answer this: Would I have to intercept VMware's WMQ message or can I send this message directly from my script if VMware's executible is found? Sorry for these hard questions. I'm just trying to figure this out.
|
|
|
|
|
Hello
How to get image from server into imagebox when clicking button? So what is the code I need to write in button? I am making a web page.
|
|
|
|
|
Do NOT repost the same question again and again in the same day. It'll just get you ignored for being impatient. We come here to answer questions in our SPARE TIME, not on your demands.
If you're making an ASP.NET web application (Web Forms), then ask your question in the ASP.NET Forum.
I'm not expert in ASP.NET apps, but I would imagine it has something to do with Server.MapPath().
|
|
|
|
|
porsti wrote: How to get image from server into imagebox
Are you referring to the web server, a SQL server, need more information for this request. You can also Google[^] your question as well and finds lots of sample code.
|
|
|
|
|
I am using the HelpProvider Control with a *.chm file created (sort of) through the Help Workshop. When the F1 key is pressed, a help window automatically opens to display the selected help page. Is there some way to set the size and placement of the help window that automatically opens?
Rich Feldman
|
|
|
|
|
Hi all...Im hoping someone can help us.
For our project, we need to obviously create unique ID's in our tables as one always has to. But we want to include alphabetic characters. For example, in our landlord subsystem, it should generate LL002.
Currently we simply just loop through the collection, add one more, and then concatenate it with the "LL".
However, this seems to work sometimes and not others...so it doesnt seem very stable.
Is there any other way to do it? oh- we using visual basic 2005
thanks
Dazz
|
|
|
|
|
did you try taking the (max) from the table and then add 1 to it?
|
|
|
|
|
Yes we did try take the max out, but then the problem comes in when a record is deleted. For example, if we have ten records but number five is deleted, then since there is now nine records, the next ID will be number 10. But number 10 still exists.
We then tried to simply generate a random number but there is something wrong with our block of code as only the 3 same numbers keeps getting generated.
Dazz
|
|
|
|
|
If you use the Max(column) to insert all your records then the behavior that you speak of wouldn't happen. Meaning, if you delete a record, the key for each record has not been altered. So if you take the Max(column) for the new record the answer will be LL010 still and you add 1 to it. So you will be inserting the new record with the key of LL011.
Select Max(KeyID) From Table 'returns LL010 add 1 and insert new with LL011
You would only be inserting LL010 again if the user deleted LL010 otherwise adding one will always result in a non-duplicate key.
|
|
|
|
|
thanks dude.
that helped
Dazz
|
|
|
|
|
DarynRoberts wrote: However, this seems to work sometimes and not others...
Standard question #1:
What do you mean by "not working"?
---
single minded; short sighted; long gone;
|
|
|
|
|
Heres an idea, assuming SQL Server
Add 3 fields to the table
IDNo int Identity(1,1)
Prefix char(2) default 'LL'
TableID varchar(20)
Add a calc in your insert proc to add prefix & IDNo together and stick into TableID. I think the IDNo may only be generated by the commit of the insert transaction.
You can probably do the last step with a trigger but I loathe triggers so would not recommend it.
OR
do a select top 1 on the id, increment and save with the prefix, caveat this will be nasty on a high use system.
|
|
|
|
|
Perhaps you should reply the original poster instead of me...
---
single minded; short sighted; long gone;
|
|
|
|
|
Just wanted to say thanks to everybody who gave input.
ciao.
Dazz
|
|
|
|
|
Hi
I have a VBA application that reads from a config file on a network drive. It does this fine.
However when I use the File System Object to look for directories below the network path eg:
FSO.FolderExists(path) where path is \\DansComputer
It returns false.
Does this function work accross a network and if so what am I doing wrong. (It has worked fine locally).
Thanks
Dan
|
|
|
|