|
Or initialize it in the constructor
--edit
What Mark said!
I are Troll
|
|
|
|
|
I want to ask if you used a wizard control on windows form? which one your recommend?
|
|
|
|
|
I always make my own using panels and a little bit of logic - not very difficult and much simpler than trying to manipulate some pre-existing control to fit my needs.
|
|
|
|
|
Thanks I did the same and it's fine now
|
|
|
|
|
I am currenctly using the AdRotator control on C# WinForm with AdvertismentFile but I want to make a use of mySQL and use it as source for my banner by selecting random banner from the database..
my question how can i set and use the Impressions?
|
|
|
|
|
Hello friends,
I need to create a application which sholud pop up near system tray(like skype or g-talk etc), can any one help me how to do this or any links or samples, I googled enough for the day, let me know any thing with u also guys?.
Thanks in Advance
|
|
|
|
|
|
So you googled enough! Instead of typing this long long question you should have googled this:
".NET" +"C#" +"system tray" +"pop up"
And Oh noze, even here on CP:
http://www.codeproject.com/miscctrl/balloonhelp.asp
Yes I see that was clearly asking to much of you.
*Sadly shakes head*
|
|
|
|
|
Dear,
I would like to please you if someone can help me with using .m files in C#. I have made some function in Matlab and now I need to use it in C# application. I made .dll file with matlab deploy tool but I have problem when I use it in C#, my programs dosn`t execute, when I run it?
Thanks
|
|
|
|
|
|
anyone know of a way of subtract image from image to get the difference?
|
|
|
|
|
This really depends on what you mean by difference (i.e. subtraction).
You could iterate over the points and subtract the
RGB values from each other to gain your new image.
Leaving open what to do with the edge case when the
difference goes below zero. You also need to remember
that subtraction is not commutative.
What kind of difference do you really mean?
Cheers
Manfred
|
|
|
|
|
http://yfrog.com/j227627210j i have this two images wanting to find either the difference or the similarities of the image and display the output in a pictureBox.
will this work?
or i have to convert image to bytes?
modified on Sunday, November 21, 2010 11:14 PM
|
|
|
|
|
You would need to do this pixel for pixel. Just iterate through all pixels in the image and substract them. Store the substraction result as pixel in a new bitmap of the same size as the two images you want to compare.
|
|
|
|
|
do you have an example? meaning example pixel(0,0) of image 1 minus pixel(0,0) of image 2?
|
|
|
|
|
public static Bitmap Diff(Bitmap src1, Bitmap src2, int x1, int y1, int x2, int y2, int width, int height)
{
Bitmap diffBM = new Bitmap(width, height, PixelFormat.Format24bppRgb);
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
Color col1 = src1.GetPixel(x1 + x, y1 + y);
Color col2 = src2.GetPixel(x2 + x, y2 + y);
int r = 0, g = 0, b = 0;
r = Math.Abs(col1.R - col2.R);
g = Math.Abs(col1.G - col2.G);
b = Math.Abs(col1.B - col2.B);
int dif = 255 - ((r+g+b) / 3);
Color newcol = Color.FromArgb(dif, dif, dif);
diffBM.SetPixel(x, y, newcol);
}
}
return diffBM;
}
This code should create a greyscale image that shows the difference between two bitmaps. If you need more information, ask google. There's lots of information to be found about this topic.
|
|
|
|
|
|
Sorry this question might seem vague, but I was wondering how to create dynamic installers? Maybe I'm not wording it right so let me explain the situation. We use a monitoring software and with this software you can create clients that have location(s). Each time you create a location within a client, you will see another installer popup on the web interface. Now what you do is you download this agent installer for your location, and it will install the agent on your computer. This agent creates a directory on your filesystem along with installs and runs two services.
So my question is.. how exactly are they doing this? Because when you create the location it automatically creates a link on the webpage for a installer. Now with this certain installer it somehow has embedded your location ID which makes it when that agent installs it already puts you under that location. I noticed that the location is set in the registry so when it is dynamically creating it, it is embedding it to install setting that registry to that location ID.
I've looked using reflector and wasn't able to find it.. it was a pretty large program so I'm still looking. I would love to hear your ideas on making this work similar to that way
|
|
|
|
|
Hi Jacob,
My first guess might be that they are using the Windows Installer API to create MSI databases.
See about it here:
http://msdn.microsoft.com/en-us/library/aa372860(v=VS.85).aspx[^]
See also the database manipulation functions:
[^]
The difficult we do right away...
...the impossible takes slightly longer.
modified on Sunday, November 21, 2010 4:42 PM
|
|
|
|
|
I don't think they are doing that. Reason is because it is not a MSI file, it is a exe file. I did open reflector on the exe file and see where the install can take arguments but I just don't know how it is getting those arguments from that file you download.
I found stuff like this:
set.ReadXml(Assembly.GetEntryAssembly().GetManifestResourceStream(Assembly.GetEntryAssembly().GetName().Name.ToString() + ".Template.xml"), XmlReadMode.ReadSchema);
So it appears to me that someway when you create a client, they are changing the Template.xml embedded resource.
When you go to the webpage and click the link for your agent it is actually pointing to a Deployment.aspx?ID=LOCATIONID page. The number cooresponds with the location ID. Which there are templates that coorespond with that location. So it is changing that template.xml file based upon the location ID and the template is a embedded resource
modified on Sunday, November 21, 2010 6:34 PM
|
|
|
|
|
Using the Microsoft API you have the option to create a MSI or a an exe. Without seeing anything you are talking about it is difficult to even guess, however the code could be embedded in the msi database or the code could be constructed on the fly using CodeDOM with the code embedded within it
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ahh I was thinking since it was talking about a MSI installer it only did MSI. I don't really have any code. I used reflector to look at the code to see what they were doing. I can try to explain this..
Ok there are agents and each agent have a "location" (city, town, etc). Now there are templates assigned to each location. These templates can contain stuff such as the server address, port, location id, tray icon file, etc. So in the control center application you create your locations and pick the template that goes with them. When you create a location and set the template it creates a link on the webpage for that installer (so it automatically creates a custom installer)
So on the web interface where you download the agent EXE file, it is going to a Deployment.aspx page and is passed the LocationID as a query string. You download the EXE file, install it, and now your computer shows up automatically under the correct location.
So after digging around in reflector I noticed that the installer is default for all of them. The only thing that changes is the embedded resource Template.xml. So what I think is happening is the Deployment.aspx page is querying the database for the locationid template information and creating a new Template.xml file. It is then replacing the Template.xml that is already in the agent installer with this new Template.xml. So when you install it, it is setting all the information in the template.
So my question is if I have a EXE that I created, how do I replace the embedded resource with a updated file? This means I would have to open the EXE file and somehow figure out where the embedded resource file is and replace it programmically.
|
|
|
|
|
Get a look to Wix.
It's essentialy an XML file that contains instructions for generating an MSI. So you could create an XML base template, customize it with the data required by the specific installer you need and then build id by using MSBuild.
|
|
|
|
|
Ahhh I'll take a look at that too.
Note: I removed the code since it is not mine. It is code I found using reflector. I feel that I might of violated some license agreement by posting snippets of the code that I found. Although I would love to learn how they were capable of reading the bytes of the executable and replacing only the bytes that related to the Template.xml.... it is not worth being sued over lol
modified on Monday, November 22, 2010 7:08 PM
|
|
|
|
|
Hello i have this grayscale image and i wan to convert the pixel black all to white.
for (int i = 0; i < grayImage.Height; i++)
{
for (int j = 0; j < grayImage.Width; j++)
{
if (grayImage.GetPixel(j, i).A.ToString() == "0" && grayImage.GetPixel(j,
i).B.ToString() == "0" && grayImage.GetPixel(j, i).G.ToString() ==
"0" && grayImage.GetPixel(j, i).R.ToString() == "0")
{
grayImage.SetPixel(j, i, Color.White);
}
}
}
pictureBox5.Image = grayImage;
i use the above code however it dont seems like it is working when i assign the grayscale image to another pictureBox it appear as the original image.
needing help!
modified on Sunday, November 21, 2010 11:00 AM
|
|
|
|