Lev Danielyan
Posts
-
Source Control -
Creating a label without absolutely no paddingIf you feel it is going to be interesting for people, and if you've had some interesting solution, then why not, go ahead ;)
Regards, Lev
-
How can I make an Image tranparentRight :laugh: :laugh:
Regards, Lev
-
How can I make an Image tranparentYou're welcome
Regards, Lev
-
Why C# doesn't have macro like C++These are different languages, with different features, that's it. This question is kinda like a holywar starter :)
Regards, Lev
-
How can I make an Image tranparentWell, let me say again. If you want to make the whole image transparent, this is equal to creating an empty image of the same size and resolution and saving it, i.e. dropping the content of the image. You could have modified the code I've sent pretty easy, but anyway, here it is:
Image img = Image.FromFile(@"c:\logo.png");
Bitmap buffer = new Bitmap(img.Width, img.Height);
buffer.SetResolution(img.HorizontalResolution, img.VerticalResolution);
buffer.Save(@"c:\logo2.png");This will give you the same source image, BUT without the content (I actually wonder what is this for ;))
Regards, Lev
-
What's the best way to check thatWell, if you cannot disable the button, then, I guess, you should go for what Giorgi has suggested
Regards, Lev
-
How can I make an Image tranparentNaveed khan nido wrote:
I want to make transparent whole image
What do you mean? if you want the whole image to be transparent, just create a new image object and save it right away. That's not one or two colors, the SetColorKey accepts two color objects to specify the range of colors to make transparent.
Regards, Lev
-
create customize controlI wish I did it on purpose :laugh: :laugh:
Regards, Lev
-
What's the best way to check thatI would disable the button on starting the process and enable it back when the process is done working. Like this:
private void button1_Click_1(object sender, EventArgs e) {
button1.Enabled = false;
Process proc = new Process();
proc.StartInfo.FileName = "notepad.exe";
proc.EnableRaisingEvents = true;
proc.Exited += new EventHandler(proc_Exited);proc.Start();
}void proc_Exited(object sender, EventArgs e) {
button1.Enabled = true;
}Regards, Lev
-
undo changes on table in database -
create customize controlYou can inherit a control from System.Windows.Forms.Label and override its OnPaint event:
// Constructor
public BorderLabel() {
InitializeComponent();
this.Paint += new System.Windows.Forms.PaintEventHandler(BorderLabel_Paint);
}// Event
void BorderLabel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
Brush brush = new SolidBrush(Color.Red);
Pen pen = new Pen(brush);
Rectangle rect = e.ClipRectangle;// this is needed to see the right and bottom edges
rect.Inflate(-1, -1);e.Graphics.DrawRectangle(pen, rect);
}Regards, Lev
modified on Thursday, January 8, 2009 6:15 AM
-
How can I make an Image tranparentFirst create a buffer image of the same size and resolution as the source image. Then draw the source image on the buffer, specifying the transparent color using the ImageAttributes. Something like this:
Image image = Image.FromFile(@"c:\logo.png");
Bitmap buffer = new Bitmap(image.Width, image.Height);
buffer.SetResolution(image.HorizontalResolution,image.VerticalResolution);Rectangle destRect = new Rectangle(0, 0, image.Width, image.Height);
ImageAttributes attributes = new ImageAttributes();
// Set the transparent color
attributes.SetColorKey(Color.Red, Color.Red);using (Graphics gr = Graphics.FromImage(buffer)) {
gr.DrawImage(image, destRect, 0, 0, image.Width,
image.Height, GraphicsUnit.Pixel, attributes);
}buffer.Save(@"c:\logo2.png");
Regards, Lev
-
Mobile number is displayedI guess you are using Java and this is a Java security issue. AFAIK this is handled by the Java emulator/executing environment.
Regards, Lev
-
Folder and file viewNope, he can't. From the message context it seems he is developing a desktop app, and you are talking Asp.Net ;)
Regards, Lev
-
How to create a Web site in which user can create his mail accountJust like Eliot said :) But with Google Apps you won't need to purchase a hosting and pay for e-mail addresses, just a domain name is enough. I've already given you the link, but here it goes again Google Apps[^]. Read their tutorials and you'll have everything straightened out. PS. I switched to google apps a couple of months ago, and it's really cool for a free product (they do actually have a commercial version with more options, but you decide what you need ;))
Regards, Lev
-
Silver Light Tools Information Requiredyou're welcome
Regards, Lev
-
Silver Light Tools Information RequiredTo make it short: When you create a new Silverlight project you actually get two projects in a solution 1. The actual Silverlight application 2. An ASP.net application, to execute the Silverlight application. After all the Silverlight app should be executed in a browser by a plugin. Now, you are talking about the missing ASP.Net controls. You are supposed to get only two of them, one is the "Silverlight" which is a placeholder your Silverlight app will work in, and another one is a asp.net control which represents a MediaPlayer. Check the Silverlight application in the solution, this is where you will develop all the stuff. I would also recommend you to get a good book on Silverlight and check the "Learning" section at www.silverlight.net
Regards, Lev
-
To Create Button Template StoryboardHere is an example of animating on mouseover:
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Border"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>Also, check out this link Storyboard Class[^]
Regards, Lev
-
Silver Light Tools Information RequiredGo through this guide http://silverlight.net/GetStarted/[^] Basically you'll need only Silverlight Tools for Visual Studio 2008 SP1[^], it says it is for VS2008 Service Pack 1, do you have it installed? If not, go grab it from the MS site. I just installed the Silverlight Tools a couple of days ago, on a freshly instaled Vista with VS2008SP1, and it worked fine for me.
Regards, Lev