I am using the following code and it does create a B/W image as desired but it seems to be very slow. IS there a better way to do this? Thanks in advance.
Dim bm AsNew Bitmap(picCanvas.Image)
Dim X AsIntegerDim Y AsIntegerDim clr AsIntegerDim r AsIntegerDim g AsIntegerDim b AsIntegerFor X = 0To bm.Width - 1For Y = 0To bm.Height - 1
clr = (CInt(bm.GetPixel(X, Y).R) + _
bm.GetPixel(X, Y).G + _
bm.GetPixel(X, Y).B) \ 3
bm.SetPixel(X, Y, Color.FromArgb(clr, clr, clr))
r = 255 - bm.GetPixel(X, Y).R
g = 255 - bm.GetPixel(X, Y).G
b = 255 - bm.GetPixel(X, Y).B
bm.SetPixel(X, Y, Color.FromArgb(r, g, b))
picCanvas.Image = bm
You call bm.GetPixel 6 times with exactly the same X and Y values - do it once only and store the result.
Next, you calculate the average of RGB values, set that to the pixel, and call again that GetPixel method, just to substract its value from 255. Do you think the RGB values are different here from each other?
Why don't you just substract the average from 255 before the first SetPixel call (and throw away the second half of the method)?
I am using signtool for verifying the certificate in my application. Before calling signtool i am setting the visual studio variables using batch file "%VS100COMNTOOLS%....\VC\vcvarsall.bat. After this if I call signtool.exe then my build succeeds even if any files has certificate issues (not certified or bad signature)(More clearly we can say that the MSBuild will start a new process for signtool inside and check its return value, in this case though the return value is non-zero, the MSBuild call will not consider that and the last error will not be a non-zero). My issue is, i ported my solution from 2010 to 2013 and currently i am using new MSBuild version. For this i am calling "%VS120COMNTOOLS%....\VC\vcvarsall.bat to set all the VS variables. After calling this batch file the MSBuild engine version set to 12.0, in this case if I call the signtool.exe for a file with bad signature then the MSBuild project file will end with an error, because the signtool.exe will return 1 and as a result the MSBuild project build failed. How can treat the return value of signtool.exe in MSBuild file? How can i manage that return value? Is there any way we can suppress this return value?
Hello I'm asking this a relevant question on how to get those temporary internet files for IE (Windows 8) if there's another directory?
Caused the variable I declare are:
Public Internet_Explorer_tempfiles As String = profileAppDataLocal() & "\Microsoft\Windows\INetCache\IE\RYBQB324"2
Public Internet_Explorer_tempfiles1 As String = profileAppDataLocal() & "\Microsoft\Windows\INetCache\IE\RVPDD4X6"3
Public Internet_Explorer_tempfiles2 As String = profileAppDataLocal() & "\Microsoft\Windows\INetCache\IE\CPYQ0PWH"4
Public Internet_Explorer_tempfiles3 As String = profileAppDataLocal() & "\Microsoft\Windows\INetCache\IE\A3AG311A"
However those 8 random characters are not consistent to other systems which considered to be fixed so what loop code could get the files from a directories even though there's so many folder named with random 8 characters
The function that I'm referring is the part of ccleaner when detects temporary internet files
Currently on the progress of making a program where those random 8 characters after scanning did not detect those files.
I want for scan algorithm where when this directory "\Microsoft\Windows\INetCache\IE" is assigned, the folder contained in IE will be read and retrieved those files (the 8 random characters) instead of assigning it.
The problem is, the method I'm using is fixed and on my another system it contains bunch of folder with 8 random characters.
i need a running program that will capture a qr code and transfer the data immediately to the field i make in the visual basic... the program would be like a punch card their will be a time in and time out of the employee
i have a plain vanilla vs2013 pro on win7 64bit - does anybody have the slightest idea what is going on, or what term i should be googling to try to find what's going on?
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
There are a couple things I would like to do. First, I like the simple numeric indicator of impediments. How do I do that? I know how to make charts etc., but there is no such control. I only see Pie, Bar, Column, Stacked Bar, and Pivot Table. Any idea how to get a smaller chart like he has in the link to show a simple numeric count?
Apparently you just pin the query and the count shows up as a small icon on home page. Sweetness.
Also, How do I change the Text Color? I know I can click the graph part to change its color, but when I click text I get nothing. For some reason my text displays are in yellow and it is very hard to see.
So after some review it seems a co-worker is seeing black font but I am not. I am seeing yellow in both an IE and Chrome browser and I am seeing it all multiple systems. Is there a user setting or something that is changing it to yellow?
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
The interesting thing about software is it can not reproduce, until it can.
With that lack of detailed information, I doubt it very much. Check that the project files you are trying to open are not corrupt, check any error messages at the time of failure, check the Windows event logs ...
I want to extract zip counted by bytes transfer and update progress bar until all files is extracted, this code is working, but progress bar will update for each file extracted and progressbar return to 0 value for every file, how to fix that, please help me.
I use BackgroundWorker1, ProgressBar1, BtnExtract, BtnExit, Label1.
PrivateProperty CurrentCount AsIntegerPrivateProperty TotalCount AsIntegerPrivateSub BackgroundWorker1_ProgressChanged(sender AsObject, e As
System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
' ProgressBar1.Value = e.ProgressPercentage
CType(e.UserState, ProgressBar).Value = e.ProgressPercentage
EndSubPrivateDelegateSub SetStatusTextInvoker(ByVal Text AsString)
PrivateSub SetStatusText(ByVal Text AsString)
IfMe.InvokeRequired ThenMe.Invoke(New SetStatusTextInvoker(AddressOf SetStatusText), Text)
Label1.Text = Text
EndIfEndSubPrivateSub ExtractZip(ByVal szFileZip AsString, ByVal ExtractTo AsString)
Dim TotalSize AsLongTryUsing zip As ZipFile = ZipFile.Read(szFileZip)
AddHandler (zip.ExtractProgress), New EventHandler _
(Of ExtractProgressEventArgs)(AddressOf ProgressExtract)
ForEach Entry As ZipEntry In zip.Entries
TotalSize += Entry.UncompressedSize
NextForEach Entry As ZipEntry In zip.Entries
NextEndUsingCatch EX As Exception
EndTryEndSubPrivateSub BackgroundWorker1_DoWork(sender As System.Object, _
e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
EndSubPrivateSub ProgressExtract(ByVal sender AsObject, _
ByVal e As ExtractProgressEventArgs)
If BackgroundWorker1.CancellationPending Then
e.Cancel = TrueEndIfSelect e.EventType
Dim Entry AsIntegerDim CurrentCount AsInteger = Entry
BackgroundWorker1.ReportProgress(CInt(Math.Truncate(100 *(e.BytesTransferred / _
EndSelectEndSub#Region" Button Exit"PrivateSub BtnExit_Click(sender AsObject, e As EventArgs)Handles BtnExit.Click
PrivateSub BtnExtract_Click(sender AsObject, e As EventArgs)Handles BtnExtract.Click
EndSubPrivateSub BackgroundWorker1_RunWorkerCompleted(sender AsObject, _
e As RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
ProgressBar1.Value = 0
Label1.Text = " Done"EndSubEndClass
modified 8-Jul-14 5:29am.
Last Visit: 31-Dec-99 19:00 Last Update: 21-Dec-14 0:36