|
If it's a new machine, I would guess that you've got some configuration problems. I made a similar move (32-bit XP to 64-bit XP), and none of my code runs any slower than it did before.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello All ,
I have a Matrix which transforms the Graphics object during the OnPaint event handler to "zoom in/out" of a Panel that I have depending on this matrix.
I want to Invalidate() a specific region that is of absolute coordinates (relative to the control though). When the OnPaint method is called, I want to be able to set the transformation on the Graphics object and then paint a rectangle around the e.ClipRectangle region. Here's the problem: when you perform Graphics.DrawRectangle for the ClipRectangle AFTER it has been transformed, the rectangle is transformed and is now RELATIVE to the transformed Graphics object (and therefore translated and resized by the zoom scale). How can I transform the ClipRectangle such that it is the "same size and location" as the absolute rectangle? I basically want to inflate/deflate it depending on the zoom. This is so that it can be drawn and used to perform hit testing AFTER the transformation. I have several "shapes" that I want to make sure are INSIDE of the invalidated region, but the only way to do this is to transform the ClipRectangle .
I know this is a bit confusing so if you need more explanation, let me know.
Cheers!
|
|
|
|
|
Hi All,
I want to compress Image to maximum rate, what the best Algorithm can I use?
If any one have a class to do that, please give me it ?
Ala Qunaibi
|
|
|
|
|
Depends on the content of the image and the type of compression you like to have:
- lossy or lossless
- picture has few distinct colors (like a comic) or is a photograph
For photos, you should choose jpeg or some wavelet based algorithms like jpeg2000.
Both offer lossy and lossless compressions, although the lossy ones work pretty well for photographs, but look a bit ugly with high compression ratios (you will get lots of artifacts).
For pictures with only a few colors, you can choose the palette based GIF (up to 255 colors) or PNG for images with more colors. PNG offers lossless compression.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks,
My Images are Photos and Compression type is lossless.
Can You help me , where can I find source code about What you said, or Examples?
Ala Qunaibi
|
|
|
|
|
Greeeg wrote: For photos, you should choose jpeg or some wavelet based algorithms like jpeg2000.
Both offer lossy and lossless compressions
No, there is no lossless JPEG compression.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
Matty22 wrote: JPEG 1991 supports lossless compression
No, it doesn't. That's an addition made in 1993, and it's not supported by the standard libraries.
wikipedia: Lossless JPEG[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I'm developing a SMS server, for which I need to store income SMS request and response of my appliction on those SMS in Windows message queue. I've done Googling but could not find some appropriate material. Please help me out.
|
|
|
|
|
Google MSMQ - there's a ton of resources out there, here's some links to some CP articles:
CP MSMQ Search[^]
|
|
|
|
|
I've been experimenting with various implementations of two-way communications using WCF over MSMQ, and without ever thinking it would work, tried the following:
using System;
using System.ServiceModel;
namespace MessagingSample
{
[ServiceContract]
public interface ISampleContract
{
[OperationContract(IsOneWay = true)]
void StartDoingSomething(string someText, SampleClient client);
}
[ServiceBehavior]
public class SampleClient
{
private ISampleContract workerService;
public void StartClient(string server)
{
EndpointAddress endpointAddress = new EndpointAddress(
new Uri(string.Format(@"net.msmq://{0}/private/SampleQueue", server)));
NetMsmqBinding clientBinding = new NetMsmqBinding();
clientBinding.Security.Transport.MsmqAuthenticationMode = MsmqAuthenticationMode.None;
clientBinding.Security.Transport.MsmqProtectionLevel = System.Net.Security.ProtectionLevel.None;
ChannelFactory<ISampleContract> channelFactory =
new ChannelFactory<ISampleContract>(clientBinding, endpointAddress);
workerService = channelFactory.CreateChannel();
}
public void StopClient()
{
if (workerService != null)
{
workerService = null;
}
}
public void StartDoingSomething(string text)
{
if (workerService != null)
{
workerService.StartDoingSomething(text, this);
}
}
public void DoSomethingElse(string text)
{
System.Diagnostics.Debug.WriteLine(text);
}
}
[ServiceBehavior]
public class SampleServer : ISampleContract
{
private ServiceHost serviceHost = null;
public void StartServer(string server)
{
Uri serviceUri = new Uri(string.Format(@"net.msmq://{0}/private/SampleQueue", server));
NetMsmqBinding serviceBinding = new NetMsmqBinding();
serviceBinding.Security.Transport.MsmqAuthenticationMode = MsmqAuthenticationMode.None;
serviceBinding.Security.Transport.MsmqProtectionLevel = System.Net.Security.ProtectionLevel.None;
serviceBinding.MaxReceivedMessageSize = 1024 * 4096;
serviceBinding.ReaderQuotas.MaxArrayLength = 1024 * 4096;
serviceHost = new ServiceHost(typeof(SampleServer));
serviceHost.AddServiceEndpoint(typeof(ISampleContract), serviceBinding, serviceUri);
serviceHost.Open();
}
public void StopServer()
{
if (serviceHost != null)
{
serviceHost.Close();
}
}
public void StartDoingSomething(string someText, SampleClient client)
{
System.Diagnostics.Debug.WriteLine(someText);
client.DoSomethingElse("Processed: "+ someText);
}
}
}
If you create another couple of applications - one that implements the SampleClient, and another that implements the SampleServer - both will communicate in a two-way fashion over MSMQ using this code.
If the server is down/stopped, messages will be queued and returned to the original client when the server comes back online. In situations where a message is received by the server but the client no longer exists it all fails silently - i.e. no exceptions at the server, and the response method call is simply lost in the ether.
The first question is why does it work? I'm not passing any service endpoints for the client to the server, so how is the server able to address the client? All of the two-way MSMQ/WCF samples I've seen thus far require that the client also act as a server.
The second question is when will it not work?
Note: you'll need to create a queue named "SampleQueue" in MSMQ for this all to work of course.
|
|
|
|
|
Try coding it in Java. C# sucks big time. May Allah give you the knowledge
|
|
|
|
|
The operative word there being try, of course.
P.S. Do you always submit message board posts that make you sound like a total moron, or was this just an isolated instance?
|
|
|
|
|
Furty wrote: Do you always submit message board posts that make you sound like a total moron, or was this just an isolated instance?
Dude i was showing u the right path for programming
|
|
|
|
|
Meer Osman Ali wrote: Dude i was showing u the right path for programming
Right. Gotcha.
I had you pegged as a trolling wanker, but thanks for the confirmation!
|
|
|
|
|
Furty wrote:
I had you pegged as a trolling wanker, but thanks for the confirmation!
Gee have a nice day then
|
|
|
|
|
If it farts like a troll, smells like a troll, and looks like a troll, shouldn't we just castrate it?
|
|
|
|
|
Absolutely not. It would fart, smell and look like a troll even more,
and scream its heart out on top of that.
On the other hand, if it intends to procreate, you would have to
accept these short-term disadvantages, and go for the long-term benefits.
Or act a little more effectively and solve the problem once and forever.
PS: nothing much has changed around here, has it?
|
|
|
|
|
Luc Pattyn wrote: PS: nothing much has changed around here, has it?
Same ol', same ol'. Mind you, I've spent the last month or so working on a bit of Open Source work along with Karl Shifflett, so I've spent less time in the forums as a result.
|
|
|
|
|
No, pretty much every post he's made is from a completely ignorant viewpoint.
|
|
|
|
|
Allah has given us C#. Java is an abomination to Allah, a heretic language. Are you rally suggesting that we ignore the progress that He has granted us? Ignore type-safety? Drop the increased productivity?
That sounds like the arrogance that Iblis would display
As Spock would say, "Live long and prosper"
|
|
|
|
|
I created a xsd file using a xml, and then loaded it into a dataset. It created several tables according to the xsd. I notice that each table has a auto-generated column (name ends with ..._id, it looks like the dataset uses these ids to determine the relations between each table).
the problem I am having is that when I fill each table in the dataset with data, then write it out to a xml file, the xml file does not come out in the format defined by xsd, e.g. the child element becomes sibling elment of the parent element
defined in xsd
<parentelement>
<firstelement></firstelement>
</parentelement>
output xml file will become
<parentelement>
</parentelement>
<firstelement>
</firstelement>
When I debug it, I find out that the reason is that in dataset, the auto-generated "parentElement" table's id(key) column is updated automatically(0,1,2...), but the "childElement" table's id column is still empty, therefore cause the two table not to "link" to each other(I found out that by adding child table's id column with 0,1,2.., the xml will come out in the correct format).
I use
adp.fill(ds, "parentElement") and adp.fill(ds, "firstElement") to fill both table, can't figure out why only the parent table's id column is auto-populated not the child one.
Please experts help!!
|
|
|
|
|
It seems that you might have problems with mapping datasets to xml's.
You can find here[^] excellent code snippets, which will lead you to the correct solution.
SkyWalker
|
|
|
|
|
Hi
I have 4 arrays which i want to insert them into 4 columns of a table of my sql server 2000 database, and it should be done at once, not inserting one by one. How can i do this?
|
|
|
|
|
Transactions
http://en.wikipedia.org/wiki/Atomicity_(database_systems)
|
|
|
|