|
But he does state that he is "rendering transparent PNGs"
A png with alpha channel should render just fine onto any background color.
Using a wand tool to crop the edges away is useful for gif's and such, but PNG's have 255(?) levels of transparency and shouldnt have any problems with antialias.
(But I have no clue whats wrong in this case)
|
|
|
|
|
I think what your thinking of is the alpha components of colours which is essentially transparency, however the wand tool will not dither the neighbouring pixels with varying degrees of alpha component (as far as I know) so in essence what you have is the body of the picture with 0% alpha (i.e. fully opaque) and the borders were dithered previously with red, in this case. The red which was for example #f00 was replaced with #f000 (100% transparent) but the neighbouring ones were left as, well, pinkish.
The only way to correct this would be to manually edit the png, for example (I'm using Fireworks because it's what I know) you can replace the transparency with red and then use the wand tool to select red but turn down the tolerance so that it hopefully removes all the obvious red. For a smoother edge turn the wand to smooth edges as opposed to crisp or hard.
|
|
|
|
|
Your are right i am using a PNG 24 with 255 levels of transparency.
But its not the image that is my problem, for example, in photoshop the png is displayed with all 255 levels of transparency. i think c# somehow converts the image in a lower 1bit alpha channel format but i am not sure about it. if you could just upload an image that is implemented in c# and thats has all 255 transparency levels it would be a big help for me. of course without any artifacts at the boardes.
my second thought is that c# just doesnt support png24 and semi-transparency.
|
|
|
|
|
Hello
I use this code to create users in active directory, and set their passwords:
static void Main(string[] args)<br />
{<br />
DirectoryEntry parent = new DirectoryEntry("LDAP://test/OU=Admins,DC=test,DC=org");<br />
Console.WriteLine("OU: "+parent.Name);<br />
Console.WriteLine("Domain name:" + System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain().Name);<br />
string test = "testuser";<br />
for (int i = 0; i < 20; i++)<br />
{<br />
try<br />
{<br />
DirectoryEntry child = parent.Children.Add("CN=" + test + i.ToString(), "User");<br />
Console.WriteLine(test + i.ToString() + ": create object");<br />
child.Properties["name"].Value = test + i.ToString();<br />
child.Properties["displayName"].Value = test + i.ToString();<br />
child.Properties["GivenName"].Value = test + i.ToString();<br />
child.Properties["Initials"].Value = "q";<br />
child.Properties["sn"].Value = test + i.ToString();<br />
child.Properties["sAMAccountName"].Value = test + i.ToString();<br />
child.CommitChanges();<br />
Console.WriteLine(test + i.ToString() + ": commit info");<br />
child.Invoke("SetPassword", new object[] { "!qwe@ASD" });<br />
child.CommitChanges();<br />
Console.WriteLine(test + i.ToString() + ": commit passowrd");<br />
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine(test + i.ToString() + ":"+ ex.ToString());<br />
}<br />
}<br />
}
Within the loop, some users are created and their passwords set successfully, and randomly setting password for some users fail with this error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DirectoryServices.DirectoryServicesCOMException (0x80072030): There is no such object on the server. (Exception from HRESULT: 0x80072030)
--- End of inner exception stack trace ---
at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
What are the possible causes for this error? and what are the workarounds?
|
|
|
|
|
Any luck?
Luis Fernando Forero G.
|
|
|
|
|
We have solved the issue long time ago, so I don't remember the issue accurately.
But as I remember, it was related to replication. There were multiple domain controllers serving the domain. If first CommitChanges saves data to dc1, the second may go to dc2.
The solution is to add users in batch and replicate the domain controllers then update the password in another cycle.
|
|
|
|
|
hi
how can i attach picture to database ?
working in SQL server 2000 + #C 2005
thank's
|
|
|
|
|
|
I have to revisit a VS2003 project from years ago, but I cannot open it. I installed SP1, but it's made no difference. The message I get is 'Unable to read project xxx. The file xxx.csproj is not a valid project file. The project file is missing the 'VisualStudioProject' section'.
Sure enough, if I create a new VS2003 project, the XML starts with that node. The projects I have do not have that, and are much denser. But, the 'Visual Studio Version Selector' opens it with VS2003, and VS2005 offers to convert it ( then chokes ). Worse still, I tried creating a new project and found I must have some files that are not used, because some classes were declared twice. This is a long time ago, I am really stuck trying to work out how to access these files.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Perhaps the easiest would be to create a new project and add all the code back into it. Alternatively you can try and compare two project files (a valid one with this one) and restructure the corrupted portions.
|
|
|
|
|
Thanks, I was hoping to avoid the former, and for the latter, the csproj files seem to be in an entirely different format, the element it's looking for is the root of the XML document. But, it's not a VS2005 format, either.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah I've got the feeling that VS2003 was a plain text format and VS2005 moved to an XML format which to be honest it makes more sense.
Just a random thought, what about trying SharpDevelop since that can import all the versions as far as I know.
|
|
|
|
|
Cool idea, thanks, I will try it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hello all. I am new here; a student of programming! I am developing an app similar to Windows Explorer. I have everything working great. But I have one question:
Can anyone tell me what I may need to do to be able to click on a directory in the Listview and repopulate the Treeview in the left pane?
Any help would be much appreciated!
|
|
|
|
|
|
Thanks for the feedback, but I have researched these things and I don't see how to do what I need, which is not add a node, but rather redraw the treeview to repopulate an existing node.
For example:
if I click the program files directory in the treeview, the directory is expanded in the treeview to show all of the folders; all of the folders and files are displayed in the listview. What I need to do is this:
by clicking on a folder in the listview, lets say the Adobe folder, I want the Adobe folder in the treeview to be expanded to show all of the folders one level under the Adobe folder. Of course this should work for as many clicks in the listview as the user performs. Any suggestions?
|
|
|
|
|
I want to create a custom binding navigator control but I have some problems.I want to add some toolstrips(Items) to my control but I don't know how i can reach it
|
|
|
|
|
Hi I've been trying to find some way of have two systems establish a TCP connection via a Relay server so as to support clients behind a firewall/router with having to manually forward ports which can be done via an outbound connection. So the Client program sends socket info to the server which the server stores and passes to another client so that the two client can connect to each other. The problem lies in that I cannot convert System.Net.Socket to a Byte array to send it over a network stream. Any help would be hot.
Thanks in Advance
|
|
|
|
|
Can you explain in more detail as to what you're trying to accomplish because I think you've got confused over what can be done.
|
|
|
|
|
I need to have a server machine accept an incoming TCP connection as a socket. Then duplicate that socket and send it over a network stream to another tcp client.
EG. convert System.Net.Socket to binary and back.
|
|
|
|
|
Are you trying to get all communication to go through this realy server or just the initial stuff?
If option a) then set up a little protocol which sends the target machine in the opening and you'll have to write a "relay" client which looks for this information and simply copies the data from one to the other.
If option b) then you can't simply translate it into binary, send it and convert it back. What you'll have to do is send a message to the relay instructing it to send a message onto the other client which provides the necessary information (i.e. ip address) for it to establish a direct connection with the initiating machine.
|
|
|
|
|
Hi All,
What a great place this is!!!
I’m pretty new to .NET and fairly new to true OOP in general really. I’ve recently made the decision to move the development of an app I’m working on from FoxPro (which I know fairly well) to .NET & C# and I have some questions before I start moving this new version of the project forward.
To give some back ground on the FoxPro version. It basically scans the entire directory structure of the host machine (logical drives C:\, D:\ etc …) for files with certain file extensions and builds a database of them for sorting and querying. It extracts information about each file and stores that as well. All pretty basic stuff really and due to FoxPro being a database language its fairly dictated as to how this data is structured and stored … i.e – Its in tables in a Database.
The problem …
Now that I’m moving this over to the .NET framework (into a WPF App in fact) I have a stack of questions about how I should structure this data.
The recursion is easy using the built in classes DirectoryInfo and FileInfo etc … the question I have is how do you recommend I structure and store the results? The obvious one to me is in an array but I’m sure there is a better way. This is where I’m sure a few of you will laugh. I’m still a bit confused about what I can actually do with Objects which is why I’m here. I want to get this right from the get go. Avoiding anything boxing etc …
Would you create one object with parameters like (for argument sake):
public file
{
public Directoy
public FileName
public FileSize
public Extension
public Date
}
If so how would you add many entries (the equivalent to FoxPro records) to that one instance of an object?
Or would you create an array of objects that each in turn hold the required details about just one file? Or something along the lines of a DataTable maybe?
I think some of the source of my confusion is that I also need to persist this data on the host machine once its built from the directory structure by serializing the object(s) to disk. Can you even do that with an array of objects?
Anyway, I think that’s enough for now, I’m sure that any and all responses will generate more questions from me. Thanks for any input / direction / code examples.
|
|
|
|
|
The easiest way to add multiple records to an object, is to store a list inside the object. My question is, what do you do with this data ? If you need to search it, perhaps a list is more easy to traverse than a tree.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Christian,
Thanks for a quick reply!
Basically the functionality of the app is:
1. Scan the machine for certain files (based on a lookup file)
2. Grab various bit of information about each file and store those as well
3. Categorise files on things like strings found in the directory location and file name etc ...
4. Display the information in a grid (Directory Location, File Name, File Size, Date etc ...)
5. Provide data bound (bound to the lookup files) controls on the interface to query the complete list of files
When you refer to lists I'm assuming you mean Generics?
Once the software has scanned the machine and built the initial list that data also need to be persisted on the machine and reloaded each time the app is started. I'll also add in functionality to scan for new files. Things like that.
Regards,
James.
|
|
|
|