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
D

dbstudio

@dbstudio
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Development today
    D dbstudio

    I strongly believe that it should be less rigid and more flexible and who don’t want to have a const signature if you are not changing the value, I feel the it’s more due to the fact of junior developers fresh out of school believing we are building a kernel or cathedral if you wish.

    The Lounge

  • Development today
    D dbstudio

    👋 all Do you find yourself in a PR battle where you discuss if you should use const or const ref, or otherwise discuss why you use using to reduce the name of certain types, I can get so frustrated sometimes when I develop a feature or new code, I have it tested and all work and then you have this colleague who wants everything to be how he or she is seeing it and in the end it doesn’t matter as you spent more time discussing or changing it for their joy, code wise it would end up as the same code for the compiler.

    The Lounge

  • Graphics in C# versus Graphics in Java
    D dbstudio

    Hello guys and girls I'm recently started on C# but as I know abit programming (Coming from Java) it should be easy to do this, but as I have experienced from Microsoft its never easy on customizing or subclassing their components (I've tried in Win32/C Old school, but thats many years ago) The question is: I want to draw a dropshadowborder on a panel and/or take it further to draw all components with a dropshadow when they are added to the panel I started on subclassing Panel to override OnPaint, but as I cannot do the following code (atleast not yet) in C# I would like to have an explanation if you guys/girls are up for it or willing to help me out so I learn abit more this day // Sample code working in Java

    @Override
    public void paint(Graphics g) {
    if (shadow == null) {
    BufferedImage buffer = new BufferedImage(getWidth(),
    getHeight(),
    BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2 = buffer.createGraphics();
    super.paint(g2);
    shadow = factory.createShadow(buffer);
    g2.dispose();
    g.drawImage(shadow, distance_x, distance_y, null);
    g.drawImage(buffer, 0, 0, null);
    } else if (isVisible()) {
    g.drawImage(shadow, distance_x, distance_y, null);
    super.paint(g);
    }
    }

    // End of sample snippet My snippet in C#: //Snippet from C#

    protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
    {
    Image buffer = new Bitmap(Width, Height);
    Graphics g2 = Graphics.FromImage(buffer); // Here I want to take a "snapshot" of the panel it self or the components added to the panel but cant quite see where I shall steal the "image" I know atm this is "white"
    g2.FillRectangle(new SolidBrush(Color.Black), new Rectangle(5, 5, Width, Height));
    e.Graphics.DrawImage(buffer, 0, 0);
    }

    I know the code convertion isnt exact the same but it was to point out my problem I hope you can see what I want to do, and I hope someone is willing to spend some minutes answering me with some theory. My Best Regards and Wishes David Bundgaard

    C# graphics help csharp java question
  • Login

  • Don't have an account? Register

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