|
Colin Angus Mackay wrote: I'm getting old.
As long as you're not mellowing.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The real question is why he didn't mention SQL injection attacks.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
A well deserved 5 sir.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you dont have any other work...MR.Pete O'Hanlon
|
|
|
|
|
What are you on about?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
suppose
bmp1 = new Bitmap(530, 335);<br />
bmp2 = new Bitmap(250, 200);
in which, bmp1 contains an image but bmp2 is empty
now,
bmp2 = new Bitmap(bmp1);
Since there are diffrence between the size of bmp1 and bmp2,so image of bmp2 losing the pixels due to the shrinking.
Am i right? i know i right.......
but i want shrink the desir pixels like
bmp1 = new Bitmap(bmp, 530, 335);<br />
bmp2 = new Bitmap(530, 335);<br />
Graphics gg = Graphics.FromImage(bmp2);<br />
p = new Pen(Color.Red, 1);<br />
for (i = 0; i < bmp1.Width; i++)<br />
{<br />
for (j = 0; j < bmp1.Height; j++)<br />
if (bmp1.GetPixel(i, j) == Color.FromArgb(255, 0, 0) && <br />
bmp1.GetPixel(i + 1, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 2, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 3, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 4, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 5, j) == Color.FromArgb(255, 0, 0))<br />
{<br />
gg.DrawEllipse(p, i, j, 1, 1); this.Invalidate();<br />
<br />
i += 6;<br />
}<br />
means that sense the only red pixels,if 6 pixels are in one row then change these six red pixels with the one pixel.
like
RRRRRRRRRRRBBBBRRRRRRRRRRBBBBBBBBBBBRRRRRR R=red,B=blue
R R RBBBBR R BBBBBBBBBBBR
iS it right method?is it efficeint method? for reducing the length of line of desire color.
i am confuse
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
zeeShan anSari wrote: bmp1 = new Bitmap(530, 335);
bmp2 = new Bitmap(250, 200);
in which, bmp1 contains an image but bmp2 is empty
now,
bmp2 = new Bitmap(bmp1);
Since there are diffrence between the size of bmp1 and bmp2,so image of bmp2 losing the pixels due to the shrinking.
Am i right? i know i right.......
No.
You create bmp2 as a bitmap of 250 by 200 pixels
You then create a new bitmap based on bmp1 and assign it to the variable that WAS holding the reference to the bitmap you previously created. This previously created bitmap no longer has any references to it and the garbage collector will get it.
|
|
|
|
|
and now,
bmp2 = new Bitmap(bmp1,250,200);
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
Is there a way to do this using .net 2
thx
|
|
|
|
|
Try this[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi guys
I have problem running a remote WMI query in my threaded application.
What I am doing is querying allot of clients 5000+ in our network, after a while WMI starts returning wired random exceptions like RPC service is not available.
I’m using C# .NET 2.0
I’m using the Treading.Treadpool.
WMI is working fine on the clients. Both remote and locally.
It’s W2k clients
So basically my question is doesn’t WMI play nice in a multithreaded environment?
/Johan
|
|
|
|
|
What are some of the other exceptions? Are you cleaning up the WMI connections correct? From a command prompt you can run "netstat -an" to see if your local box has lots of ports open (LISTENING) or in TIME_WAIT.
I'm assuming you are not reusing the same WMI object in more than one thread at a time.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi Tom
Thanks for the reply. I have allot of ports in TIME_WAIT. They dosent seem to be relesed. I dont know why they dont get relesed.
Do i need to do anything more??
public bool ServiceRunning(string n, string q)
{
ConnectionOptions co = new ConnectionOptions();
TimeSpan ts = new TimeSpan(1000);
co.Timeout = ts;
ManagementScope ms = new ManagementScope("\\\\" + n + "\\root\\cimv2", co);
ObjectQuery oQuery = new ObjectQuery(q);
ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(ms, oQuery);
ManagementObjectCollection objCol = null;
try
{
objCol = oSearcher.Get();
_WMIStatus = "WMI Running";
if (objCol.Count > 0)
{
return true;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
objCol.Dispose();
oSearcher.Dispose();
}
|
|
|
|
|
The TIME_WAITs are normal[^] but you may be opening and closing too many connections too quickly. If you read this[^] you will see it says you are basically limited to ~200 connections a second. You can adjust the time wait period at your own risk though.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi Tom
Thanks allot for your help.
/Johan
|
|
|
|
|
hi,
let suppose
bmp = new Bitmap(530, 335);
I think it’s means that bmp is consist of 530 x 335 pixels.
Am I right ?
|
|
|
|
|
Yes 530 is pixels width and 335 is height.
|
|
|
|
|
You are correct.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
Or even looked at the constructor tooltip when typing. It's the 5th overload of the constructor out of 12. Says very clearly Bitmap.Bitmap(int width, int height)
|
|
|
|
|
Or even checked the .Width or .Height of the bitmap after construction.
|
|
|
|
|
I am working with large files in a compressed state. From what I can find it is not possible to copy compressed files without uncompressing first. Does anyone know if it is possible to copy compressed files compressed? As I am writing the code in C# I have included the question here.
Thanks for any help.
Jim
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
What do you mean by "copy"?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
The archive contains 3-7 files, if a change is made to one file the old archive is maintained "as is" and a new one with the change is created. The files which were not changed need to be added to the new archive, or copied.
Jim
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
to modify the contents of a compressed archive it will need decompressed and recompressed afterwards. I suspect you can find a library that will hide the details for you.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|