|
|
I was recently using the .NET bitmap class to create a copy of a bitmap by using the constructor to pass in the original bitmap. When I did this with a square bitmap (ie 10x10) Things worked fine. However, when I passed in a non-square (10x12) bitmap the pixels were scrambled in odd ways.
It was simple enough to get around the problem, but I was just curious if this is a known bug in the framework, or is there simply something I am failing to consider when using this technique, (or am I having LSD flashbacks)?
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Stan Shannon wrote:
However, when I passed in a non-square (10x12) bitmap the pixels were scrambled in odd ways.
It was simple enough to get around the problem, but I was just curious if this is a known bug in the framework, or is there simply something I am failing to consider when using this technique, (or am I having LSD flashbacks)?
What is the problem and how did you get around it? I have never seen that happen, although the loaded JPEG was rather simple (just a background).
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
The problem was that the bitmap resulting from the this:
Bitmap bmp2 = Bitmap( bmp1 );
produced a scrambled pixel pattern if bmp1 was not a square bitmap. If is was square (i.e. 10x10) things were fine.
I got around it by simply processing the original bitmap and not using the above code. (I did not need to store the original but was just experimenting with the second bitmap). I did not attempt to clone the original so I don't know if that would have made a diference.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Web site: http://test.labdotnet.com/GenuineChannels/GenuineChannels.html
Genuine Channels implement bidirectional TCP channels (for .NET Remoting infrastructure) that solve the primary problem of native tcp channels and all sequential issues. Also they implement some features that help to build durable, viable and stable client-server solutions.
Brief explanation
Microsoft .NET Framework implementation of TCP channels allows using TCP channel only as a server or client connection. If you want to provide feedback from the server to client, server must connect to the client’s port. This scheme consumes two TCP sockets and is not workable if client is behind NAT or Masquerade server. Also, native implementation closes TCP connection after non-customized period of time.
Genuine Channels use the only connection from the client to the server. There is no problem if client is behind firewall, NAT or Masquerade server. Also, Genuine Channels implement some features to help building durable, viable and stable client-server solution.
Features
Only one TCP connection is used between client and server.
Fully compatible with .NET Remoting infrastructure.
Each connection has queue of messages being sent.
Constraints on the queue are possible. It greatly helps to force reconnection if current connection is too slow.
Automatic client reconnection to the server. Server and Clients does not lose messages during reconnection. It’s very useful if your server must talk to the client.
Full support of sync, async and one-way messages.
Adjustable timeout to wait for reply from the remote host.
Real async processing. You can have any number of threads at a server and at a client that will automatically use the same TCP connection.
Each exception has unique identifier that simplifies centralizing error processing or translating error messages to any language.
Automatic ping to check TCP connection if connection has not been used for (by default) 120 seconds.
Detailed logging system that receives all events and can save even the entire incoming and outcoming TCP streams as well as exceptions, stack traces and object’s guids. You can write your own logger and attach it to the system.
Dmitry Belikov.
|
|
|
|
|
Developing a network file backup application and need to
be able to see all machines on a network, select
drives/dirs/files for backup.... currently, I have an app
similar to Windows Explorer, with a treeview to look at
my own computer's data, with no problems... need to
add "My Network Places" to this (similar to Windows Explorer)
and be able to go out on
the network and get similar info for other
workstations.. plus I need to be able to create folders
and copy files to these PCs... I think I'm kinda close
with System.DirectoryServices and System.Management, but
can't seem to find what I'm looking for... any help or
suggestions would be much appreciated... thank you.
|
|
|
|
|
Is there someone who can tell me how to create the effect equivalent to Java's Flow Layout Maneger? In my concrete case, I would like to have a single column listview, where the elements are thumbnail images, similar to the standard UI presented by PowerPoint.
Thanks in advance
|
|
|
|
|
Is there a way to compile to native code rather to MSIL.
The problem with MSIL is its an open code, where everyone can just look at what you wrote, and beside that , native code will save the time of the compiling at run time, therefor it will be faster.
So is there a way to tell VS.NET to compile the code to native?
Amir Harel
My boss always tell me: Why we always search for the generic solution for a specific problem...
|
|
|
|
|
To try to get ahead on speed look into using ngen.exe.
Not sure if it affords any safty from decomp though, just a speed increase.
The only thing that can protect the IL is an obfuscator.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
From what I have heard, you have an obfuscator part of the VS.NET 2003 package.
|
|
|
|
|
Can they span multiple assemblys (sp)? I am assuming that they can, but can’t seem to find anything that says definitively 'YES'. I will admit that it is late and I am probably not searching right on Goggle... but I just can't find it...
Also, Are there any recommendations for namespace hierarchies? I am considering:
[company_name]
[app_name]
[section_name1]
…..
[section_name2]
I assume that if I set the root namespace for each project to [company_name] then preced each class with the ‘namespace’ directive for [app_name] I can then nest the [section_name] namespaces inside of that.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Ray Cassick wrote:
but can’t seem to find anything that says definitively 'YES'.
'YES'
This is used extensively throughout the framework, especially when you look at the assemblies that are meant to assist development (System.Design.dll).
Ray Cassick wrote:
I assume that if I set the root namespace for each project to [company_name] then preced each class with the ‘namespace’ directive for [app_name] I can then nest the [section_name] namespaces inside of that.
Pretty much
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
|
|
Has anyone here used it for any projects?
Log4net clickety[^]
I have been looking it over for a project and am looking for some other impartial views of it.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
|
I've not used NUnit yet, but I do plan on including it with the development of my University degree's final year project (a big distributed commercial web service -- see a post below for a basic overview).
Anyway, NUnit is just a way of building automated unit tests, with the aim of producing a suite of tests that you can run to prove that the code does what it's supposed to -- and that anything you add hasn't broken something old.
The way I'm looking at including it from the outset (you add attributes 'n stuff ) is around a kind of one-person eXtreme Programming. By using these tests I can ensure to a certain degree that the code is successful, and should give me some good info to put in the report with regards to testing.
The other thing about XP (as far as I've understood it) is that one of the aims is to build elements of a system as quickly as possible, once its functional you move on. So I can do tests for features, once the tests complete ok I can move on ... there isn't a great deal of design involved before the coding.
I have to say its quite bureaucratic (including all this NUnit testing support) but I'm hoping it'll be worthwhile in the long-run, and should be a good learning experience.
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Use NUnit (and NAnt which is awesome) for team development: daily builds and automated testing are essential whenever you're working with others on a project.
I didn't look into Log4net yet; i think it uses the pattern of Listeners which you can attach to a general logging system; just as you can do with the Trace classes in .NET
Gertjan Schuurmans
Amsterdam
The Netherlands
|
|
|
|
|
The "current node" is not the node that I am right clicking on to bring up the popup menu.
The menu handler looks like this:
private void mnuAddElement_Click(object sender, System.EventArgs e)
{
TreeNode tn=tvSchema.SelectedNode;
tn.Nodes.Add(new TreeNode("Element"));
tn.Expand();
}
And the node is correctly highlighted, but after adding the new node the highlight reverts back to whatever node was selected using a left click.
What do I do about this? I want it to work like it should--right clicking operates on the node that the user clicked on, not the last left-clicked node.
Help!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka
|
|
|
|
|
|
Thanks!
Almost works. The mouse position by this point is over the item the user clicked in the popup menu.
You led me down the correct path though, which is to write a mouse down event handler:
private void EventMouseDown(object sender, MouseEventArgs e)
{
tn=tvSchema.GetNodeAt(e.X, e.Y);
}
and save the node the user clicked on.
Note that it has to be a mouse down event. I tried mouse up, but that doesn't fire until the popup menu is done, and thus the mouse position is again wrong.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka
|
|
|
|
|
I've got a Windows Forms application (C#) and I have several cursors that I've drawn which I want to be able to embed in the application. I am able to load the cursors from a file, but not as an embedded resource.
Can anyone give me some pointers about how this is accomplished? I am using VisualStudio.Net.
Thanks.
|
|
|
|
|
Ok, this is going to be a little off-topic, but its a .NET Architectural-type question.
I'm working on the architecture to my University final year project, which is based around a commercial XML Web Service providing access to high performance analytics (courtesy of a third-party database).
However, it will also need to perform a number of menial housekeeping work too -- providing audit trails, reporting etc. It would be useful to have some kind of application that can effectively monitor the web-service too, i.e. current load that kind of thing.
I am considering using the following design:
ASP.NET Web Service <----> Windows Service <-----> Databases
With the Windows Service providing access to all the gubbins that hooks the web service together. That way, an administrative application can then access the windows service to get at the reporting info.
Does anyone have any opinions, or suggestions as to how this kind of thing might be done?
Alternatively I'd thought about adding filters using Microsoft's recently released Web Services Enhancements pack. Adding filters for logging requests etc.
All opinions would be greatly received,
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Hi Paul,
Having this pipeline from Web Service -> Windows Service -> Database and back forces you to write (and debug) a lot of soap and remoting stuff (from outside to the WebSvc and back, from the ASP.NET Web Service to the Windows Service (remoting) and vice versa.
Consider the following approach:
Windows UI/Console client [*remoted]
|
Windows Service
|
v
Internet <---> ASP.NET <--> Busines Logic DLL <--> Database
^
|
Windows UI/Console client [*simple]
This way you can concentrate on core functionality by developing the Busines Logic Class Library and add all kinds of connectivity afterwards.
greetings,
Gertjan Schuurmans
Amsterdam
The Netherlands
|
|
|
|
|
I'd like a "BetaExpiration" attribute (DECLARITIVE security) on my classes that is enforced automatically when the assembly containing the classes is used. A security exception should be thrown if the classes are being used outside beta period.
[AllowedUse(From = "2003-1-30")]
public class x
{
public x()
{}
}
CodeAccessSecurity permission is the way to do it and I've already got an test implementation. The major problem is that my custom CodeAccessSecurity derived permission assembly should be registered on the user's machine using CasPol etc for the .Net security system to find and use it. This is not desirable. The app should just be installed and my custom codesecurity access should be enforced...
Another way is implement another custom permissing, implement IPermission, ISecurityEncodable. Unfortunately, the declarative notation is never instantiated, unless I do it myself in code; the imparative method is working fine, but I'd like to use attributes for this!
public x()
{
AllowedUse2 au = new AllowedUse2();
au.From = "2003-1-30";
au.Demand();
}
Does anyone have a bright idea how to enforce custom CodeAccessSecurity using declarative notation without requiring .Net registration of the permission assembly?
Victor
|
|
|
|