|
I need to create characters of the people as requirement of my application, I'm thinking of making cartoons from real life images, I see this done in some facebook application, how should I do this, I have done grayscale and that does not produce the result I need.
Any advice ?
Also tried box blur filter, but effect is not as desired
modified on Saturday, September 26, 2009 12:15 PM
|
|
|
|
|
Those sort of filters tend to be complex, they are certainly not a filter you can create by changing values in a convolution filter. You need to understand the theory behind it and write dedicated code to the effect you're trying to create.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi.
I'm gonna take the DateTime of 24 hours former with C# , I've written below code :
DateTime _24HoursFormer
{
get { return new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day - 1, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); }
}
But whenever DateTime.Now.Day equals 1, it throws an Exception !!
Could you guide me ?
Thanks.
|
|
|
|
|
Doesn't DateTime.Now.AddHours(-24) looks cleaner?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thanks a lot.
I didn't know it
|
|
|
|
|
d@nish wrote: Doesn't DateTime.Now.AddHours(-24) looks cleaner?
IMO the logical approach would be DateTime.Now.AddDays(-1)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Especially since subtracting hours may not work on days with leap seconds or 25 hours.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Especially since subtracting hours may not work on days with leap seconds or 25 hours.
There are no days with 25 hours, only ones with 24.
|
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: A correctly implemented DateTime class should require subtracting 25 hours on the switchover date or 23 depending on the Calender. Which is why one should subtract days and not hours.
I wish I had a dollar for every time I've been through this argument. The clocks on computers use UTC (Universal Co-ordinated Time) based on what was Greenwich Mean Time, but is now agreed by one of the UN bodies. For argument's sake it is as near to GMT as makes no difference. When you want to display the time then the library routines make an adjustment based on the local timezone and the rules for daylight saving time appropriate to that timezone. However all DateTime calculations are based on UTC so there are never any discrepancies such as you imagine; every day is 24 hours long, whatever the time of year. Only in this way can date and time calculations work correctly.
|
|
|
|
|
My original comment was in jest suggesting that a good programmer would subtract a day instead of 24 hours; hoping that the parody would drive the point home. My reply to you was to point out that it is entirely possible to come across a 23 or 25 hour day in an implementation. Of course, your reply will once again ignore the point I was trying to make so I don't know why I bother.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: My original comment was in jest suggesting that a good programmer would subtract a day instead of 24 hours; hoping that the parody would drive the point home.
Your original comment: Especially since subtracting hours may not work on days with leap seconds or 25 hours.
Spot the humour? Well I didn't.
Ennis Ray Lynch, Jr. wrote: My reply to you was to point out that it is entirely possible to come across a 23 or 25 hour day in an implementation.
Not so, this is what you actually said:
Your reply: A correctly implemented DateTime class should require subtracting 25 hours on the switchover date or 23 depending on the Calender. Which is why one should subtract days and not hours.
No, still can't see either joke or parody.
Ennis Ray Lynch, Jr. wrote: Of course, your reply will once again ignore the point I was trying to make so I don't know why I bother.
As far as I could see, the point you were trying to make was that there are dates in the calendar where a day can equal 23 or 25 hours.
And since you seem to take umbrage when someone misses your hilarious joke, I'm not sure why you bother either.
|
|
|
|
|
True.
On the lighter side, he does not wants the day before but the time 24 hrs less than current time. Hence the reply.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Correct.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
This is a Compact framework question...
I'm building this application that deals with a lot of images coming from the network (~30 k a piece). I am starting to see serious memory issues arise after a while. While my images are mostly cached and the cache is cleaned up if you play with the app for long enough you get an out of memory exception. I can see the app running with up to 25 megabytes of memory in use, the problem is I'm not entirely sure what is causing this. My best guess is that the bitmap caches the decompressed version of the image after its been shown on the picturebox, either that or the picturebox does.
Is there a way to reduce the memory footprint while still having that amount of images (roughly 30) in memory, the only way I can think of is to not put the actual bitmap on the display but rather a copy and after the bitmap has been shown to let the garbage collector handle the copy, however I'm pretty sure that thats going to hurt performance.
Any other idea's?
|
|
|
|
|
You do call Dispose() on images you no longer need, do you?
If that doesn't help, show us some code.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Aurigma.com has an extension to .NET (GraphicsMill) that allows creating and saving TIFF images with LZW compression. Besides saving memory, compression also speeds up loading, saving, and transmitting images.
|
|
|
|
|
Hello,
I have a stream witch are send directly on printer using IP adresse and port, I want to receive this stream ans save it on file : for exemple PCL.
Please help me to resolve this problem. thank you verry mutch.
|
|
|
|
|
hi, I've been trying all the ways to access controls on the mainform from a class but something is missing.By the way, access modifier of the controls I want to access are all Private and I want to access them using public properties and methods. Here is the situation, thanks for your help.
I don't want to make "high coupling", wanna access just a few controls.
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
public string buttontext //using either this
{
get { return this.btn1.Text; }
set { this.btn1.Text = value; }
}
public void button1Text(string txt) //or this
{
btn1.Text = txt;
}
}
public partial class masaCubuk : UserControl
{
public masaCubuk()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//accessing with this
MainForm frm = new MainForm();
frm.buttontext="sample";
//or with this
MainForm frm = new MainForm();
frm.button1Text("sample");
}
}
|
|
|
|
|
|
but it is not recommended and I wanna figure out how it is done with public properties and methods
|
|
|
|
|
It's done the same way, but with a property "in between"
|
|
|
|
|
So do it. The property get / set is the way to go, but your code fragment should work, pretty much. You presumably have frm.Show() or frm.ShowDialog() somewhere, so what's the problem?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
there is no frm.Show(), I'm just creating an instance of the mainform and trying to get or set the value of controls on the mainform
|
|
|
|
|
And the code you posted will do that - you just won't see the results if you don't show the form...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|