|
It looks like you are not resizing the rectangle.
Just racking up the postings
|
|
|
|
|
just tried to resize the rectangle as below (for x and y ). but this co-ordinate varies from point to point.
public void ZoomIn()
{
if (sz1.Width >= 800 * 6)
MessageBox.Show("Max ZoomIn");
else
{
sz1.Width += 100;
sz1.Height += 100;
pictureBox1.Size = sz1;
c = 0;
rect1 = new Rectangle(rectangles[c].X+((pictureBox1.Width/rectangles[c].Height)+(pictureBox1.Width/100)),rectangles[c].Y+((pictureBox1.Height/rectangles[c].Width)), rectangles[c].Width, rectangles[c].Height);
rectangles.RemoveAt(c);
rectangles.Insert(c, rect1);
rect = new Rectangle(0, 0, 0, 0);
}
}
How to resize it...
modified on Tuesday, July 13, 2010 7:01 AM
|
|
|
|
|
ratio = Convert.ToDouble(sz1.Width) / Convert.ToDouble(pictureBox1.Width);
rect1.X = Convert.ToInt16((rectangles[c].X) * ratio);
rect1.Y = Convert.ToInt16((rectangles[c].Y * ratio));
rect1.Width = Convert.ToInt16(rectangles[c].Width * ratio);
rect1.Height = Convert.ToInt16(rectangles[c].Height * ratio);
rectangles.RemoveAt(c);
rectangles.Insert(c, rect1);
pictureBox1.Size = sz1;
|
|
|
|
|
Below is sample code from one of my recent apps. I used this pattern a lot when designing searchable objects. I know that by appearances, there will be more than two method calls involved.
However, I've read that the C# compiler inlines short blocks of code.
Will the "Contained" method be inlined at compile time?
public bool Contains(BindingPathNodeType nodeType)
{
return IndexOf(nodeType) != -1;
}
public int IndexOf(BindingPathNodeType nodeType)
{
int intCount = parsedPathNodes.Length;
for (int i = 0; i < intCount; i++)
if (parsedPathNodes[i].NodeType == nodeType)
return i;
return -1;
}
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|
|
|
# DEFINE Contains(x) (IndexOf(x) != -1)
|
|
|
|
|
What is this? Some kind of shorthand?
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|
|
Yeah, kinda.
|
|
|
|
|
If BindingPathNodeType is a reference type then there seems to be nothing that prevents inlining.
But, as has been said, you still don't know for sure whether it will be inlined.
What has not been said though is that it also depends on whether you NGEN, and whether it's 64bit, and 64bit NGEN is completely different from anything else, IIRC not even created by the same team (instead of being developed by the CLR team, it was developed by the Visual C++ team)
'Contains' is not a leaf method, while I have read nothing about non-leaf methods not being inlined, in other compilers inlining is often done on leaf methods first.
|
|
|
|
|
Thanks for the heads up. I don't NGEN any of my code so I'm probably in trouble.
I hate having to enter the same code block twice because:
1. It looks dirtier.
2. More lines to (possibly) debug.
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|
|
I don't think I can use ClickOnce (or can I?) because it's a plugin....
|
|
|
|
|
|
If you architect the application correctly with plugin modules, or MEF, it can be used to deploy the modules.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
This should be posted in the Lounge as it's not a C# question.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Thank you ,
My thought ( Would Lounge know what is the IL code ? )
I know nothing , I know nothing ...
|
|
|
|
|
Most would, but I get your point.
It was more of a statement/comment than a question IMO, if meant as a question then the .NET Framework forum would have been the correct place.
I didn't mean it personally hence not downvoting your post
[Edit: unlike others I see )
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
I didn't downvote, but there is a certain "lives-under-a-bridge waiting for goats" smell around the OP....
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Stark DaFixzer wrote: Man , the .NET Exe file can be easily disassemble
OK I'm gonna bite, which .net exe file?
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Maybe they were thinking "this would be a nice way to get more support for 64bit" or maybe "this would make it easier to support new instruction sets in old programs without recompiling them" but if they were thinking that they should think again, it's true of course but they are still using the FP stack instead of SSE registers.
|
|
|
|
|
Thanks , I hate 64 bit things
I know nothing , I know nothing ...
|
|
|
|
|
People that worry about their code being recompiled are worrying about the wrong things. I seriously doubt Apple would care if you managed to completely reverse engineer and steal there iStore for iTunes or whatever it is called because you would not be able to steal their market share or business model. And that, is what is important.
Most software that can be thought of as needing real protection from decompiling can actually be protected by patents, trademarks, and DMCA suits.
|
|
|
|
|
Thank you ( Very convincing replay )
I know nothing , I know nothing ...
|
|
|
|
|
|
Is it really that different than disassembling a native executable? No matter what language it's in, or how it's compiled, it can be broken down and analyzed.
My thoughts are, put a bit of money/effort in to disuade 'casual' disassemblers, and that's probably enough. Anyone who cares enough can crack any application.
|
|
|
|