|
No. Don't even go down that road. If you really want to protect your code, hide it behind a webservice (and even then the server is going to get hacked someday and someone will have your code). Otherwise the code has to be decryptable by the user - how else is he going to run it? You can put a nice big lock on a door, if you put the key under the mat it's still useless. Until processors implement public key encryption (and I hope to god they never will), there is nothing you can do.
You can obfuscate the code, but remember that it won't stop anyone but a bored teenager in his moms basement. And maybe not even him.
|
|
|
|
|
I am trying to draw two paraller curves side by side.
Width of both curves should be increased or decreased. Also the sweep angle is variable and can be increased or decreased. What is the best possible way to do this using C#?
I am actually writing this for Paint.Net but for support I am writing this code first in visual Studio using C#.
|
|
|
|
|
|
Hi, Thank you for your reply. I have done the same and acheived the basic result but the problem is when I increase the width of the Pen then it increase on both sides and thus overlap the second Arc. I have also tried to change the Arc position when the pen width increases but it not remains the same and looses symmetry when i give the higher pen width.
|
|
|
|
|
And you are sure you have offset the Rect properly to compensate?
"You get that on the big jobs."
|
|
|
|
|
Hi everyone.
I have drawn a square on the screen/form using GDI. Now I want to move this object around using keyboard inputs. I just want it to move along the x-axis using left and right arrow keys. I can assign the keys but the problem is making that object move. You help on this is highly appreciated.
|
|
|
|
|
How you move it is going to depend to a large extent on how you drew it / are drawing it.
The basics are pretty obvious though: two integers, one for X and one for Y. Up key decreases Y value, Down increases it. Left key decreases X, right increases.
But there are three common ways to draw a rectangle:
1) On a panel or similar control. In this case, use the new X and Y values on the Panel.Location to move it.
2) On the form via the Paint event: In your Paint handler, use the X and Y to set the top left position of the rectangle. When you modify X or Y, use the Form.Invalidate method to force a re-draw.
3) On the form via getting a graphics context for the form and using Graphics.DrawReactangle. In this case, don't. Use method 2 instead. Trust me on this!
If you have used another method, tell us what it is!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
OriginalGriff wrote: Trust me on this!
Only a fool would not.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
|
OriginalGriff wrote: the nicest thing anyone said to me all day!
It's only 11 o'clock.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Thank you.
I got it just after sending this message. I used the option 2.
|
|
|
|
|
Capture the information about the new coordinates based on key presses, then in your OnPaint() method you redraw the object at the new coordinates. Something like:
OnKeyPress(int key)
{
if (key == LEFT)
pointx -= 1;
if (key == RIGHT)
pointx += 1;
}
OnPaint()
{
DrawSquare(pointx, pointy);
}
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Thank you.
|
|
|
|
|
|
Got it. Its understandable to take this long for someone who is learning the new language like me. Thank you anyway.
|
|
|
|
|
HI All,
I Want to read an image that contains a data formatted as table in this image using MODI OCR, but when i red the image the returned text not formatted correctly.
this is a sample table saved as a picture
A5 A4 A3 A2 A1 Q.#
1 1 1 1 1 -1-
2 2 2 2 2 -2-
3 3 3 3 3 -3-
4 4 4 4 4 -4-
5 5 5 5 5 -5-
Please help me if you can.
|
|
|
|
|
zead wrote: Please help me if you can.
I'd like to help, but I don't know what your question is.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
HI,
I have an image that contains a text as table (columns and rows data) ,
I want to use OCR or MODI to read this text from image and write it in excel file as a columns.
My Question is how to use the Office MODI or any OCR libraries with .Net to do that.
Thanks
|
|
|
|
|
I am developing desktop application.Front end:Visual studio 2010.
Is it possible to change the color(foreground & background) of only selected item in the ListBox?
is this possible with mousehover event?
Please suggest the better solution
|
|
|
|
|
I'm not sure if you can do it in the way you ask, but you can use the OnDrawItem() [^] event to do your own drawing of the items.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
In this article[^] an OwnerDrawn ListBox is used to control the colors.
|
|
|
|
|
You have to either use an owner draw list box or a custom control[^] (shameless self-promotion).
|
|
|
|
|
Hallo
i get this Error when i try to load an Ax. has any one any idee?
Error:
Unable to get the window handle for the 'MyAx' control. Windowless ActiveX controls are not supported.
OS:
Windows 7 32Bit
Visual Studio 2010
modified 29-Apr-12 7:18am.
|
|
|
|
|
|
Hello,
I've a question about xmlSerializer in C#,
My question is how can you create an xmlfile with the xmlserializer from two or more different objects without creating a class contains all those objects.
For example this is the xml file wanted:
="1.0"="UTF-8"
<Root>
<Books>
<Book>
<Title>X</Title>
<Author>Mr x</Author>
</Book>
</Books>
<Movies>
<Movie> Movie Y</Movie>
</Movies>
</Root>
At the moment I'll do this with the XDocument class and create for each property an Xelement.
For example I create an XElement books which contains child elements and add them all to an XDocument and save this XDocument object.
public XElement getBooksElement(List<Book> books)
{
XElement ret = new XElement("Books");
foreach(Book b in books)
ret.Add(getBookElement(b));
return ret;
}
public XElement getBookElement(Book book)
{
XElement ret = new XElement("Book");
ret.Add(new XElement("Title", b.Title));
ret.Add(new XElement("Author", b.Author));
return ret;
}
How can be this achieved without creating a class containing all elements which should be in the object but serialize each object to an xml part and add those to the xml file.
I hope my question is clear enough,
Thank you in advance.
|
|
|
|