UnWiNd's Q&A profile
Visual C# Speeding up pixel loops - speed of Math.Pow() ?
Hello, I'm writing a simple color corrector to teach myself C#, and have come across a couple of performance problems. First, I am using Bitmap.LockBits to loop through the pixels (this part seems fast enough!). The problem I am having is having to do if statements in the loop to clamp colors if they're out of range (0-255), and also it seems Math.Pow( ) is really, really slow (which forces me to do an additional if inside the loop, even!) Here's sample code (for blue, so this is repeated for red and green as well) for the math performed per pixel, per component: if (tmpBlueGamma != 1.0) { tmp = (float)((Math.Pow((double)(srcR[x * pixelSize] * toFloat), tmpBlueGamma)) * tmpBlueGain + tmpBlueOffset) * 255.0f; } else { ...Show All
Windows Forms Why is a cell ALWAYS selected in my DataGridView
I just dont get this one. No matter what I do, whenever I load my form with a DataGridView, which has two DataGridViewComboBoxColumns inserted, the first cell is always selected by default. I tried setting the focus() for one of my buttons but that did not change anything. I even tried cycling through the selectedCells property of the DataGrid and setting the Selected property to false. NO WHERE in my code, as far as Im aware, do I tell the DataGrid to have a selected cell. Is there some special way I have to do this because of the ComboBoxes If someone can help and needs to see the code, let me know.. thanks... Ok, I think I know where in my code this is happening, but I just dont know what to do about it ...Show All
Visual Studio Express Editions Unknown Error !!!
i have copied my project from one computer to other and deleted the original one, but when i run the project in new destinaion i get this error message: unable to find manifest signing certificate in the certificate store. kindly help me in this i have to complete as early as possible.... doesn't anyone know any solution to this error ...! one more thing, even when i double click, it doesn't show any error line..... too much tension..... plz help..... ...Show All
SQL Server Char Trim
Hi, I imported records from text file using BCP, in one column I am seeing blank space in starting as well in end. I printed the ASCII code it turn out as 32. But when I tried to trim with LTRIM and RTRIM it didn't work. I tried to replace the character using REPLACE witn no avail. Please help. Thanks. Louis, I was surprised to see that your varcharValue included the trailing space. I thought VARCHAR columns removed trailing spaces. So then I went to study the references and found that it depends on ANSI_PADDING in the database. http://msdn2.microsoft.com/en-us/library/ms175055.aspx The varchar data type is a variable-length data type. Values shorter than the size of the column are n ...Show All
SQL Server Variable is locked when value is set from external call using ManagedDTS
Hi all, I have a problem using variables in a Script Task. My variables are used only for reading values, so the variables are listed in the ReadOnlyVariables property of the Script Task. My package is called from a .NET class using the ManagedDts class. The .NET class set the values for the SSIS package variables used in the Script Task. When I execute the SSIS package from VS2005 with default values set for the diferent variables it work's fine. When the package is called from the .NET class I have the following error: "Fail to lock variable..." I thought the problem was that the .NET class keeps a lock on the variables when setting the values so I have added a call the Unlock() method of the variables collection ...Show All
Visual Studio Team System Can't we save "Data Compare" / "Schema Compare"
I just started using Database Professional and it is a cool and great addition to VStudio. Thanks for all the efforts! Coming to the actual question: Is there any way to save Data Compare My scenario is, once the target database is build, I need to check the static/reference data status. I am able to do this using Data Compare but couldn’t figure out a way to save the list of tables / setting for later use. My apology if this has been answered on this forum. I have failed to search any post related to this. ...Show All
Software Development for Windows Vista Power icon problem
Hello, I've just installed the Windows Vista Beta 2 (Build 5384) and so far so good, except for one thing: somehow i can't activate the option to show the power icon on the "notification are" of the "taskbar". When i go to the properties of the "taskbar", and then go to the "notification area" options, i'm allowed to select to always show the clock, volume and network icons, but not the power icon. Do you know what can i do to fix this problem Because of this problem, i never know when the battery is low. Thanks for your help!! No... I do not have Norton 2006 Anti-Virus in my machine. I use the home edition of free Alwil Anti-Virus, Avast. But anyway, I don ...Show All
Visual Studio 2008 (Pre-release) Trigger custom Property
Hy, I want to have a TextBox with a triger on a property declared in the class, So here is the xaml that defines the object: < TextBox Name = " txtControl " Height = " Auto " Width = " Auto " Validation.ErrorTemplate = " {StaticResource validationTemplate} " > <TextBox.Triggers> <Trigger Property="Type" SourceName="TextBox" Value="3"> <Setter Property="Text"> <Setter.Value> <Binding Path="Text" Source="{StaticResource textBoxDataSource}" UpdateSourceTrigger="PropertyChanged" > <Binding.ValidationRules> <toolkit:NoValidationRule/&g ...Show All
Visual Basic Wrong output for CurentDirectory
Ok my app is deployed to C:/CompanyName/ProductName/ When I check curent dir on my developing machine by using My.Computer.FileSystem.CurentDirectory im getting path to corect location of my app Now when I deploy app to Win XP POS, and same app outputs my curebt directory im getting this: C:\Documents and Settings\UserName\ well that basically MyDocumments any one knows what is going on and why it goes there And mainly how to fix that Thanks! PS: Another thing to mention is that my app runs as alternated windows shell (I've seet it in admin template to run as alternative interace and not to load regular shell) Hi, Does your application open/save files When using a DialogBox to open/save a file, it changes the currentdire ...Show All
Visual Basic How to create object of a VB application in another VB application?
Hi, I have a COM component which is included in a vb project(say "Project1"). Now i have created a new VB project(say "Project2") and I want to access the COM instance which is present in Project1. I do not want to create a new instance of the COM component in Project2. How to do it Can I use pointers to access the dll in project1 from project2 if so, how can i do it Thanks in advance. Priya. Hi Does the COM component run in or out of process and does it register itself in the ROT Do project 1 and project 2 run within the same application domain Richard ...Show All
.NET Development Some useful classes in .NET
I have ideas about some useful classes to be created in future versions of .NET. I don't know where to post it so I post it here. Here they are: 1) Generic hashtable (it's useful when you have objects of one type in it, it helps to avoid many typecasts) 2) Array with arbitary intexes(including negative) 3) Math.Max(params ...) - Max function for many variables (int. arrays of variables) 1) already exists. It's the Dictionary<K,V> class from the System.Collections.Generic namespace: http://msdn2.microsoft.com/en-us/library/xfhwa508.aspx 2) this is somehow supported by using Array.CreateInstance method but since it's not supported by C# it's not very useful. However I doubt that C# will ever add support ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Generics.
Will Generics (and all the generic collections) Reflection BitConverter work with the CF on the 360 I've noticed that they are listed as part of CF, but I just wanted to be sure. Thanks, Roger Larsen ector wrote: Why isn't Reflection.Emit supported To stop us from writing fast game console emulators in C# :) Darn - I was hoping to port my dynarec R4400 core over to the 360 ;( ...Show All
Visual Studio Express Editions Change colour of Font when text equals certain value
This is the last thing I want to do before building and testing my program. I want the text in my textboxes to change from blue to red when they reach a certain value ie if numbers = 1, 2, 3 etc they stay blue if they reach -1 and below they change to red. Can I do this for all of the textboxes at once or do I need to code each textbox individually. How would I code this Nearly there = yippeeeeee Hi, the following code will run when any textbox's text will change. Just add all textboxes' TextChanged event on the end of the Handles part: Private Sub OnTextBoxTextChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox2.TextChanged, T ...Show All
Windows Forms MULTISELECT ON OPENFILEDIALOG
I have an open file dialog on a form, and have the multiselect set to true, but I can still only select one file at a time. Any ideas Larry Hilley Speaking of multiselection, I get a warning whenever I select a number of files say 7000 files in my OpenFileDialog control. Below states the following message: "File <complete_path_of_file> does not exist. Verify that the correct filename was given." I tried checking all of the files in that folder and verified that there are no shortcuts and no invalid characters in the filenames. And there's one time that I selected all of those files and were able to get no warning, but the number of files selected does not match the actual number of files in the folder. ...Show All
Visual Studio Express Editions Still got problem with Openfiledialog1
Hello. Sorry to botther you again. am still having problems with OpenFileDialog1 when i open a file in RichTextBox, the file opens ok, but the problem is with Rich Text Files. when I open a Rich Text file i get garbage in the file as well, like this: {\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fprq1\fcharset0 Courier New;}{\f1\fswiss\fcharset0 Arial;}} {\colortbl ;\red192\green192\blue192;\red0\green0\blue255;} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\highlight1\f0\fs20 \cf2 Private\cf0 \cf2 Sub\cf0 comboBox1_KeyPress(\cf2 ByVal\cf0 sender \cf2 As\cf0 System.Object, \cf2 ByVal\cf0 e \cf2 As\cf0 System.Windows.Forms.KeyPressEventArgs) \cf2 Handles\cf0 ComboBox1.KeyPress\par \cf2 ...Show All
