|
That Asian Guy,
Whats the purpose of your app? and Who's it aimed at?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
My application organizes math contest information, and it is aimed at adults.
|
|
|
|
|
This doesn't really have anything to do with C# does it...
Anyway, I think I prefer Sidebar and DescriptionBackground (two top ones). Which one you pick depends whats going on top, if nothing is going on top of the images then i reckon the first one. If you have to put text etc on to the image, then the second.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
excuse me firends,
have you ever seen what happens when you open 'start' from taskbar and then 'turn off computer' or 'log off'? when you click on them, the environment start to become white and black.
and i have an image in my form and i want to make a similar process to make that image start becoming white and black like you have seen in turning off your computer.
how can i do that please?
thanks
|
|
|
|
|
This requires some math, albeit some very simple math.
You need two pictures (actually, you can calculate the luma value on the fly inside the lerp method, but this one is a bit simpler and faster, but uses twice the memory):
1) the colored version
2) the grayscale/bw version
Then, based on a timer for the fading transition (let's say 5 seconds from colored to BW) you simply do a linear interpolation[^] between the colored pixel value to the BW pixel value on a time range from 0 to 1.
In a timer, you could do this (pseudocode):
const float transitionTime = 5000f;
float normalizedTransitionTime = millsecondsSinceTransitionStart / transitionTime;
red = (byte)Lerp(normalizedTransitionTime , coloredPixelR, bwPixelR);
green = (byte)Lerp(normalizedTransitionTime , coloredPixelG, bwPixelG);
blue = (byte)Lerp(normalizedTransitionTime , coloredPixelB, bwPixelB);
What the method Lerp[^] does is simply a interpolation in the form
value1 + (value2 - value1) * amount
as used in the XNA framework (for example)
float Lerp(float amount, float value1, float value2)
{
return value1 + (value2 - value1) * amount;
}
regards
modified on Sunday, June 8, 2008 12:51 PM
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks for your consideratoin. i know i'm too lazy but could you explain a bit more for me? the links couldn't help ( )
i want sth that makes a smooth conversion with an optimum speed and timings.
my problem is what should the fields 'red', 'green' and 'blue' assigned to? what are them?
i wonder if you help me a bit more clear.
thanks again
|
|
|
|
|
Hi all,
I've created a SSIS package and Loaded using C# windows application.I've imported configuration file also. but while exexute that loaded package it returns failure result.
I dont know why? But it's working with BI and returns the result successfully.
package.Execute() returns failure. Can anyone tell me how can i solve this issue?
i have placed the code which i have used in my application.
Application app = new Application();
Package package = app.LoadPackage("c:\\Example.dtsx", null);
package.ImportConfigurationFile("c:\\Example.dtsConfig");
Variables vars = package.Variables;
vars["Name"].Value = name.text.trim();
DTSExecResult result = package.Execute();
Console.WriteLine("Package Execution results: {0}",result.ToString());
|
|
|
|
|
here I have wriiten some code from my application. I j't want to know what is the advantage of this invoke method,..'coz i joined this application partially and that is almost done.If you guys know about this and eny comments plese send me....
switch (_amxStr.Trim())
{
case "DON":
this.Invoke((System.Threading.ThreadStart)delegate()
{
showDND();
strAMX = "";
frmMain.AMX_String = "";
});
break;
case "DOF":
this.Invoke((System.Threading.ThreadStart)delegate()
{
hideDND();
strAMX = "";
frmMain.AMX_String = "";
});
break;
}
|
|
|
|
|
Take a look at www.codeproject.com/KB/cpp/begininvoke.aspx[^]. The short story is that you can't directly access UI elements from any random thread, only from the thread that created the element. To update the UI from a different thread, you "marshal" the delegate to the UI thread.
|
|
|
|
|
Hi All,
I'm just using these for the first time in order to filter the contents of one List<string> based on the contents of a table retrieved via Linq ... The actual Predicate is working as I would expect it too but the foreach loop is 'breaking' and only executing once irrespective of how many records are in the Linq table. Any info or pointers would be great ... my method is shown below:
private static void FilterDirectoryList()
{
_directoryFilterList = _context.GetTable<DirectoryBlockingList>();
foreach (DirectoryBlockingList _blockdir in _directoryFilterList)
{
_filterString = _blockdir.DirectoryName;
_directoryList.RemoveAll(delegate(string s)
{
return string.Compare(s, 0, _filterString, 0, _filterString.Length) == 0;
});
}
}
Thanks in advance.
Jammer
Going where everyone here has gone before!
My Blog
modified on Sunday, June 8, 2008 7:34 AM
|
|
|
|
|
What is _directoryFilterList? Looks like a list of lists, maybe you need a 'sub' foreach.
Another thought, are you perhaps, modifying the enumerated list?
|
|
|
|
|
Hi,
_directoryFilterList is a linq table Table<DirectoryBlockingList>
I'm actually just looking at a sub foreach now ...
I'm not changing the enumerated list, that is remaining as is and i'm changing the directory listing ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
I've just tried the sub foreach thing and that's not working either ... it only ever executes the Predicate once, it complete ignores the foreach ...
I'm seriously confused ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
I have it working more reliably now that I've split the method like this:
private static void FilterDirectoryList()
{
Table<DirectoryBlockingList> _directoryFilterList = _context.GetTable<DirectoryBlockingList>();
foreach (DirectoryBlockingList _blockdir in _directoryFilterList)
{
_filterString = _blockdir.DirectoryName;
RemoveRecords();
}
}
private static void RemoveRecords()
{
Debug.WriteLine(_filterString);
_directoryList.RemoveAll(new Predicate<string>(delegate(string s)
{
return string.Compare(s, 0, _filterString, 0, _filterString.Length) == 0;
}));
}
However, I have now found out that my foreach loop using the linq Table<> hangs on the last item and never completes ... could this be related to the fact that it is a static class??
EDIT: Its all fine ... I've been caught out by the immediate window. When running the application in debug mode all worked as expected.
Jammer
Going where everyone here has gone before!
My Blog
modified on Sunday, June 8, 2008 8:39 AM
|
|
|
|
|
Sometime LINQ2SQL gets tricky, glad you sorted it out
|
|
|
|
|
I need to create an windows application that uses a database. This will be implemented on a server. Can someone tell me please if i need to add any changes to the code since it will be on a server environment.
I'm still a rookie on this subject.
Thanks
|
|
|
|
|
jonhbt,
I don't think anyone can tell you whether or not your code needs to be changed without seeing it.
It shouldn't need to be changed, as a server is just another PC, so if it runs on a desktop, then there should be no reason it wouldn't work on the server. UNLESS, you only have certain permissions/.net version limitations on the server of course...
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Thanks very much for your help. I only want to create the application for 2 computers connected to another server. This is the structure of the interface.
|
|
|
|
|
Could you define what do you mean by a "server"? Different OS / special hardware / lock-down system?
|
|
|
|
|
Hi there.
I'm new on C# . I want to know when we have to use delegate in C#.
Of course except Eevents.
Thanks in advance.
Sorry for my English. I'm a freshman .
|
|
|
|
|
You can use delegates for heaps of things, they are just function pointers.
I used them quite often when multithreading. Events are where they seem to be most commonly used though.
|
|
|
|
|
Thanks Mark.
Sorry for my English. I'm a freshman .
|
|
|
|
|
|
1) u can use a delegate if u want an object to have several method with same signature (ie, a family of Methods) but with different algorithm and u can select between these method dynamically using a delegate. Something like...
delegate double BinaryOperation(double a, double b)
BinaryOperation binaryOperation;
private double Add(double a, double b)
{
return a + b;
}
private double divide(double a, double b)
{
return a / b;
}
public static void BinaryOperationsButton_click(sender object, EventArgs e)
{
if(object is btnAdd)
binaryOperation = new BinaryOperation(Add);
else if(object is btnDivide)
binaryOperation = new BinaryOperation(Divide);
binayOperation.BeginInvoke(operand1,operand2,null,null);
}
|
|
|
|
|
I've seen similar examples but I still can't see the point.
What's wrong with this code:
{
if (sender.name == "btnAdd")
{
double result = Add(operand1, operand2);
}
if (sender.name == "btnDivide")
{
double result = divide(operand1, operand2);
}
}
for me makes reading and understanding simpler.
So, I am not using delegates, and worrying i'm missing something
Rob
|
|
|
|