|
This is not too bad but:
1. get rid of GetPixel / SetPixel / Width / Height , this is too damn slow!
2. Haven't you noticed that Bob is transparent as well?
It's what I'm trying to say since 4 posts!!!
Now it might be okay with you, but you haven't aknowledged the fact yet....
Otherwise works nicely, indeed
|
|
|
|
|
Yes, I'm aware of that. That's part of the algorithm's philosophy. If the color is close to the reference color, then the pixel can be made very transparent. Basically it tries to make each pixel as transparent as it can be. When putting the orange background behind it, it will look the same as the original again (or very close to it, disregarding rounding errors).
I'll take care of the GetPixel/SetPixel stuff, didn't bother to look for quicker alternatives yet. If you can tell me from the top of your mind that'd be great
Wout
|
|
|
|
|
|
Yeah, I tried several times to make that point, but my posts kept timing out.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: but my posts kept timing out.
I know what you mean
|
|
|
|
|
Btw, the clr should be smart enough to inline simple property getters, so I don't think any performance is gained there. Will try it out though out of curiosity.
Wout
|
|
|
|
|
Well the CLR does.
But I didn't say to cache the value of any property.
I said to cache Width and Height in particular.
Test it, you'll see...
|
|
|
|
|
wout de zeeuw wrote: Btw, the clr should be smart enough to inline simple property getters
In other words, who said Weight and Height are simple property getter?
Anyway Reflector and ANTS profiler told me they are not! :->
|
|
|
|
|
In that case you have a good case. I'll cache those when turning this thing into an article.
Wout
|
|
|
|
|
hi all,
i have 12 panel and 12 buttons on my form. each button shows a panel and hides the rest. (do i have to hide each panel one by one ???)
but i wanna know if there is an efficient method to hide the rest 11 panel with a for loop ? like :
for(int i=0;i <11;i++)
panel[i].visible=false;
//or panel{i}.visible=false;
//or panel(i).visible=false;
these codes do not work how can i correct the for part ?
help me please.
thanks in advance, bye.
|
|
|
|
|
private void HidePanels(Panel panelToShow)
{
foreach(Control control in this.Controls)
if(control is Panel)
if(!control.Equals(panelToShow))
control.Hide();
else
control.Show();
}
|
|
|
|
|
hi, try this:
for(int i = 0; i<this.controls.count; i++)
{
="" if="" (this.controls[i].gettype().tostring()="=" "system.windows.forms.panel")
{
this.controls[i].visible="false;
}
}"
<div="" class="ForumSig">Tamimi - Code
|
|
|
|
|
Office.CommandBarControl oSendReceiveAll = (Office.CommandBarControl)oBarCrls["Send/Receive All"];<br />
<br />
oSendReceiveAll.Execute();<br />
Here how can i make sure that the send/receive process is over?
|
|
|
|
|
Hi!
need some help guys
i want to match strings as whole words through regular expressions which contain meta characters.
i tried the Regex.Escape method which "Guffa" suggested me ..
it works good and don't throw any exception but it do not match the whole word also.
m i again missing some thing..
here is my code:
public bool sSearchWholeWord()
{
string sSearchWord="***SPAM***";
string content="hi this is ***SPAM*** testing";
string pattern = @"\b" + Regex.Escape(sSearchWord) + @"\b";
Regex re =new Regex(pattern,RegexOptions.IgnorePatternWhitespace);
try
{
if(re.IsMatch(content))
{
return true;
}
else
{
return false;
}
}
catch(Exception e)
{
Response.Write(e.ToString());
return false;
}
}
this returns false but according to me it should return true
also if i remove these meta charaters it returns true..
i dont know what m i missing
or is there any other way of matching these meta characters?
abhinav
abhinav
|
|
|
|
|
abhinish wrote: string pattern = @"\b" + Regex.Escape(sSearchWord) + @"\b";
Remove the 'word boundry' qualifiers. If you really need to check for a word, wrap specify spaces around the match and do explicit capture.
|
|
|
|
|
How to get the position of cursor inside a richtextbox
|
|
|
|
|
SelectionStart property
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Guys I've been able to write the program to load and display and save the file but I want the code that will check to see if the file is a bitmap file before it displays it .
So what I want from u and the code that will help me check whether the file is in a bitmap format.
Thanks.
tony-yeyo
|
|
|
|
|
do you mean .bmp ?
if so then how about checking the extension of the file?
Hope I am right
|
|
|
|
|
yeah that will work alright but i've been asked to check the bitmap file header size.
So if u can kindly give me the code to check the bitmap file header size.
thanks
tony-yeyo
|
|
|
|
|
search the net what the header contains exactly. Then read in the file binary. Check if the header is the same.
I know it should start with BM ... (see a bmp in a hex editor)
hope this helps.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
I have Windows 2003 Server, and I want to stream live content.
I'd also like to record the stream on the server, for later playback.As far as I know, I shouldn't use the encoder to create the archive this enhances the processing load on the encoding computer . I'd learnt to configure media server with media server management console to record it on the server, but I don't know how to control my Windows Media server programmatically to create an archived copy.I could have archived the streamed content in the client from where encoding initiates , that would be big overhead as archived files is to be uploaded in the server ultimately .
I didn't find the answer in the online help. Any suggestions would be highly appreciable
Many thanks,
imspratik
imspratik
|
|
|
|
|
Hi there!
i want to develop a keylogger with auto hide functionality in C#
please guide me how to implement winsocks.
2nd. I want this application to automatically download and execute through the web browser by java/vb script .... is this possible or not??
Naveed
|
|
|
|
|
Naveed Noor wrote: please guide me how to implement winsocks.
What does winsock have to do with keylogging?
Naveed Noor wrote: I want this application to automatically download and execute through the web browser by java/vb script
Oh... So you don't want to give the user any choice. It just installs itself. And I guess the winsocks is so the keylogger can report back to base.
I would suggest that what you are asking for is on the verge of the illegal and we are not going to help you commit illegal acts.
|
|
|
|
|
You want to write some kind of spyware / virus, write ?
Get out from here...
|
|
|
|