|
I linked a lot to MSDN and other CP articles, and has never been a problem. Not even a problem to post links to SO.
Akshat J wrote: Once again, thanks for the detailed response OriginalGriff. I do understand what you are trying to convey. It's not that complicated if you read the thread. It's old questions and the one who posted it gets a mail from something they asked 10 years ago. Questions aren't maintained or updated to reflect current practices, otherwise all VB6 related comment would have been removed.
Akshat J wrote: and if it comes out that there is a new hockey stadium has opened nearby and he is going towards that, they let him go. If you walk around with a stick outside the stadium it can be confiscated. Same applies to any nonsense about baseball stadiums and even kitchen-knives. If you buy them, knives are packaged. If you walk around with a knife without packaging, it will be confiscated. Depending on how others interpret your actions, e.g., if you acted threatening, then you better call a lawyer. My walking cane isn't a weapon, but if I'm on a surveillance cam raising it, it is judged a weapon, and at that moment the walking cane is not used for its intended purpose.
Akshat J wrote: Afterall, prospects of "site-driving" are not so serious a crime, especially when as Mods you have full authority to remove all the activity one does with account suspension. Cycling through a red light when there's no car to be seen isn't a serious crime maybe, but I'd still risk a fine. Rightly so. Also, it's not just moderators; if ten normal users like me report you for spam or abuse, then the account is suspended.
Akshat J wrote: I am happy to write an article on CodeProject if linking that article in response does not amount to proverbial axe wielding. Would that be a right thing to do? Testing the water to see how far we can go, are we?
That's what you're doing now it seems - asking what exactly is allowed and what isn't. Linking is simply allowed. Linking only to your site means that your intention is not helping but abusing us for advertising your site. Breaking the rules of the site might not be a crime, but it does mean you are taking advantage of a lot of volunteers. And you are surprised that people who gather here do not like that and want to stop it?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I guess I will not push this beyond a point. The links I was trying to put were not always to a personal blog. They were also to a community page which is constituted by an international collaborative effort to boost the overall perception about Internationalized Domain Names. Even when they were linked to the personal blog, it was only because there was no MSDN Page or a CP article which gave that kind of information.
I often said that looking into the contents of the answers, the content in the link, and the nature of portal to which it was being linked, would have helped before making judgement about it being a spam. The way it is going, it is appearing that I am being pushy or trying to take it to maximum limits till I can. I sincerely do not wish to do so.
I will not put any such links. It certainly limits my effort but I guess that is how it has to be.
|
|
|
|
|
Akshat J wrote: They were also to a community page which is constituted by an international collaborative effort to boost the overall perception about Internationalized Domain Names A what? You mean something like MSDN or this site? Then there would not be a discussion.
Akshat J wrote: Even when they were linked to the personal blog, it was only because there was no MSDN Page or a CP article which gave that kind of information. Oh? Please, do give a relevant example?
Akshat J wrote: I often said that looking into the contents of the answers, the content in the link, and the nature of portal to which it was being linked, would have helped before making judgement about it being a spam. Nope, it does not. You cannot expect CP to go out and judge some personal blog. Even then, none complain if I link to Joel On Software. Why not? Because it is less than 1% of my answers.
Akshat J wrote: The way it is going, it is appearing that I am being pushy or trying to take it to maximum limits till I can. I sincerely do not wish to do so. Oh, you are dear, even asking how for you can go. These "mods" as you call them put a lot of hours in answering questions. You did not.
Akshat J wrote: It certainly limits my effort but I guess that is how it has to be. Your choice. You behave nice, or you get kicked. The moderators are expected to be patient. I'm not.
It does not limit you if you want to help. It limits you only how often you link to the same fringe-resource.
Akshat J wrote: They were also to a community page Humor me, link to it now.
I'll explain later.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
And because you included those links this message was flagged as spam and sent to moderation. On this occasion I accepted it.
|
|
|
|
|
Thanks for the links.
Fair use should already tell you that you're on the wrong path. You calling sitedriving a lesser crime is the proof, innit
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Akshat J wrote: I guess that is how it has to be. This is how it is.
You can either adhere to the rules of the group, or you elephant off. The current count for abuse is 2; if you go above 10, you suspended by ordinary members. And I can call in favors to achieve just that
So, one last time and I'll make it simple. Can you play nice, or no?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: You can either adhere to the rules of the group, or you elephant off.
Of course I know where I stand as a mere user on the forum. I assumed certain rules and got rebuked, hence asked in detail. Asking got termed as pushing the limits.
Eddy Vluggen wrote: And I can call in favors to achieve just that
As a power user (hope this term does not get double quoted and taken in a wrong way) you can do what you feel like Eddy.
Eddy Vluggen wrote: So, one last time and I'll make it simple. Can you play nice, or no?
Thank you for making it simple. Playing nice was the intention from the very beginning, still is. I hope asking questions is not considered as "not playing nice.".
Good day.
|
|
|
|
|
Akshat J wrote: I assumed certain rules and got rebuked, hence asked in detail This is basic psychology and goes for every group; you do not assume, you adapt and play by the rules. If you don't, any group will lash out.
Akshat J wrote: Asking got termed as pushing the limits O, no; that is completely on my personal account as a fellow member; do not pretend that the site punished you in any form.
Akshat J wrote: As a power user (hope this term does not get double quoted and taken in a wrong way) you can do what you feel like Eddy. I am not a power-user, just a normal member. Power users have extra rights and responsibilities. Me being a normal member means I do not represent the site nor their opinion.
Akshat J wrote: Playing nice was the intention from the very beginning, still is. Good. Do an article without links and surprise me.
Akshat J wrote: I hope asking questions is not considered as "not playing nice." Being mean to a new member is also not nice, and I might get a warning or some downvotes. Asking questions is encouraged, as for every question you post, five more members read it with the same problem.
Surprise me.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
hi all,
can anybody help me to draw a thick border around round png.
Bitmap bmp = new Bitmap(@"C:\Users\Ali\Desktop\1.png");
int w = bmp.Width;
int h = bmp.Height;
Lst_Data lastpointcolor = new Lst_Data() ;
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
for (int y = h-1; y > 0; y--)
{
for (int x = w-1; x > 0; x--)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
pictureBox1.Image = bmp;
}
public struct Lst_Data
{
public Point point;
public Color color;
}
thanks in advance.
modified 16-Aug-22 4:29am.
|
|
|
|
|
What technology are you using? WinForms? WPF? Other?
|
|
|
|
|
|
Le@rner wrote: i m taking help from this article Then you should ask the person who wrote the article. As it stands you have not provided any useful information for people to help you.
|
|
|
|
|
Bitmap bmp = new Bitmap(@"C:\Users\Ali\Desktop\1.png");
int w = bmp.Width;
int h = bmp.Height;
Lst_Data lastpointcolor = new Lst_Data() ;
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
for (int y = h-1; y > 0; y--)
{
for (int x = w-1; x > 0; x--)
{
Color c = bmp.GetPixel(x, y);
if (c.A != Color.Transparent.A)
{
if (lastpointcolor.color.A == Color.Transparent.A)
{
bmp.SetPixel(lastpointcolor.point.X, lastpointcolor.point.Y, Color.Red);
}
}
lastpointcolor = new Lst_Data() { point = new Point(x, y), color = bmp.GetPixel(x, y) };
}
}
pictureBox1.Image = bmp;
}
public struct Lst_Data
{
public Point point;
public Color color;
}
can anybody help to draw more thick border around the image
|
|
|
|
|
You should have added that to your original question, and add an explanation of what is wrong.
|
|
|
|
|
You draw an ellipse and place it "over" the image where the border would be. (Images aren't "round"; they're rectangles with transparent backgrounds that simulate a particular shape).
Graphics.DrawEllipse Method (System.Drawing) | Microsoft Docs
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
how to create dynamic card view in c# and .NET6.
|
|
|
|
|
1) Write down a precise description of what you want, how you want it to work, and what you want it to look like.
2) Write some code to implement the view.
3) Test it. Does it work? Great. If not, go back to step 2 and fix your code.
Seriously, nobody can help you based on such a vague description. You either need to put a lot more thought into what you want, or go back to whoever gave you the task and ask for a lot more detail.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That depends on what you actually want to achieve, and what you expect the UI to look and work like.
At the moment, this is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?
That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!
I'd suggest that most likely you want to start with some kind of UserControl, or perhaps a TabControl but with your minimalist description we can't help you much, if at all!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'm reporting your "name" as a spam link.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I have some CSV files encoded in GBK, aka codepage 936, and need to load them as strings (or something sufficiently string-like, whatever) for further processing. In the old days, I could call some function such as File.ReadAllText (or read the file line by line etc) and specify CP936 as the encoding. But in .NET 6, I can't. The only valid options are ASCII, Latin 1, and a couple of flavours of UTF.
That sounds unlikely, right? But here is the documentation for the Encoding class, and in the big table halfway down the page, you can see that almost everything is gone. Almost as if the thinking is now "people should just use UTF-8 or UTF-16 nowadays". If it were up to me, those file would be encoded in UTF-8, but they're just not.
So, right now what I do is this, assuming that I've read the file into an array byte[] raw and int size bytes were successfully read into it:
char[] buffer = new char[size];
int numberOfChars;
fixed (char* bufferptr = buffer)
fixed (byte* rawptr = raw)
numberOfChars = MultiByteToWideChar(936, 0, rawptr, readSize, bufferptr, buffer.Length);
Calling MultiByteToWideChar via a dllimport. Then afterwards I can use numberOfChars to create a Span<char> of the appropriate length.
That works, but it seems like a serious step backwards compared to .NET 4. Also there seems to be no way (no reasonable way anyway) to read/convert chunks of the file this way, as MultiByteToWideChar does not report the leftover bytes at the end of the chunk.
Are there any better options?
|
|
|
|
|
|
|
As far as I can see, code page 936 is called "gb2312" in .NET Framework, but .NET 6 doesn't seem to know about it - as you said, the Encoding.GetEncodings method only lists seven options.
It looks like you need to register the code pages provider from the System.Text.Encoding.CodePages package, which seems to be included in .NET 6 by default:
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Encoding gb2312 = Encoding.GetEncoding(936);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Good, that works and isn't weird
|
|
|
|
|