Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

Lev Danielyan

@Lev Danielyan
About
Posts
155
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Source Control
    L Lev Danielyan

    Just to name a few 1. CVS[^] 2. Subversion[^] 3. GIT[^]

    Regards, Lev

    C# question

  • Creating a label without absolutely no padding
    L Lev Danielyan

    If 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

    C#

  • How can I make an Image tranparent
    L Lev Danielyan

    Right :laugh: :laugh:

    Regards, Lev

    C# help question

  • How can I make an Image tranparent
    L Lev Danielyan

    You're welcome

    Regards, Lev

    C# help question

  • Why C# doesn't have macro like C++
    L Lev Danielyan

    These are different languages, with different features, that's it. This question is kinda like a holywar starter :)

    Regards, Lev

    C# csharp c++ question

  • How can I make an Image tranparent
    L Lev Danielyan

    Well, 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

    C# help question

  • What's the best way to check that
    L Lev Danielyan

    Well, if you cannot disable the button, then, I guess, you should go for what Giorgi has suggested

    Regards, Lev

    C# help question

  • How can I make an Image tranparent
    L Lev Danielyan

    Naveed 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

    C# help question

  • create customize control
    L Lev Danielyan

    I wish I did it on purpose :laugh: :laugh:

    Regards, Lev

    C# question

  • What's the best way to check that
    L Lev Danielyan

    I 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

    C# help question

  • undo changes on table in database
    L Lev Danielyan

    You can use transactions and roll back in case of errors. Try googling[^] around

    Regards, Lev

    C# csharp database asp-net sql-server design

  • create customize control
    L Lev Danielyan

    You 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

    C# question

  • How can I make an Image tranparent
    L Lev Danielyan

    First 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

    C# help question

  • Mobile number is displayed
    L Lev Danielyan

    I guess you are using Java and this is a Java security issue. AFAIK this is handled by the Java emulator/executing environment.

    Regards, Lev

    Mobile visual-studio sysadmin

  • Folder and file view
    L Lev Danielyan

    Nope, he can't. From the message context it seems he is developing a desktop app, and you are talking Asp.Net ;)

    Regards, Lev

    .NET (Core and Framework) csharp question

  • How to create a Web site in which user can create his mail account
    L Lev Danielyan

    Just 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

    C# csharp asp-net com sysadmin tutorial

  • Silver Light Tools Information Required
    L Lev Danielyan

    you're welcome

    Regards, Lev

    WPF visual-studio csharp tools

  • Silver Light Tools Information Required
    L Lev Danielyan

    To 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

    WPF visual-studio csharp tools

  • To Create Button Template Storyboard
    L Lev Danielyan

    Here 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

    WPF help tutorial announcement

  • Silver Light Tools Information Required
    L Lev Danielyan

    Go 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

    WPF visual-studio csharp tools
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups