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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

r9

@r9
About
Posts
21
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Hide taskbar and change DPI settings??
    R r9

    Heath Stewart: I am new to windows programming. Can you show me how to use the SHAppBarMessage function via P/Invoke? Regards Thomas

    C# question csharp

  • Hide taskbar and change DPI settings??
    R r9

    Is it possible from C# to hide the windows taskbar? And how do I change the DPI settings? (I want to force 96 DPI, Small Fonts). Thanks Regards Thomas

    C# question csharp

  • Fill 50% of a drawing with a color
    R r9

    Hi Heath Stewart The algorithm is not the problem. But how do I fill the figure? (the C# GDI+ code is my problem) Regards C#

    C# graphics architecture tutorial

  • Fill 50% of a drawing with a color
    R r9

    Hi. Can someone show me how to fill 50% of the below drawing with a solid color. From buttom to top. Thanks Regards r9 The drawing: private System.Drawing.Graphics graphicsObj = null; private System.Drawing.Pen penBlackWidth1 = new System.Drawing.Pen(System.Drawing.Color.Black,1); private Point[] curvePoints = null; private SolidBrush lightGrayBrush = new SolidBrush(Color.LightGray); private Point point1; private Point point2; private Point point3; private Point point4; private SolidBrush blackBrush = new SolidBrush(Color.Black); ................................................... try { graphicsObj = e.Graphics; graphicsObj.DrawLine(penBlackWidth1, 45, 20, 175, 20); graphicsObj.DrawLine(penBlackWidth1, 45, 20, 45, 120); graphicsObj.DrawLine(penBlackWidth1, 175, 20, 175, 120); graphicsObj.DrawLine(penBlackWidth1, 45,120,90,160); graphicsObj.DrawLine(penBlackWidth1, 175, 120, 135, 160); graphicsObj.DrawLine(penBlackWidth1, 90, 160, 135, 160); graphicsObj.DrawLine(penBlackWidth1, 465, 335, 490, 335); graphicsObj.DrawLine(penBlackWidth1, 580, 335, 605, 335); graphicsObj.DrawLine(penBlackWidth1, 465, 335, 490, 335); graphicsObj.DrawLine(penBlackWidth1, 580, 335, 605, 335); graphicsObj.DrawLine(penBlackWidth1, 473, 345, 483, 345); graphicsObj.DrawLine(penBlackWidth1, 473, 345, 478, 335); graphicsObj.DrawLine(penBlackWidth1, 483, 345, 478, 335); graphicsObj.DrawLine(penBlackWidth1, 587, 345, 597, 345); graphicsObj.DrawLine(penBlackWidth1, 587, 345, 592, 335); graphicsObj.DrawLine(penBlackWidth1, 597, 345, 592, 335); point1 = new Point(592,335); point2 = new Point(597,345); point3 = new Point(587,345); point4 = new Point(592,335); curvePoints = new Point[] { point1,point2, point3, point4 }; graphicsObj.FillPolygon(blackBrush, curvePoints, FillMode.Alternate); point1 = new Point(478,335); point2 = new Point(483,345); point3 = new Point(473,345); point4 = new Point(478,335); curvePoints = new Point[] { point1,point2, point3, point4 }; graphicsObj.FillPolygon(blackBrush, curvePoints, FillMode.Alternate); } catch (Exception ex) { MessageBox.Show(ex.Message); }

    C# graphics architecture tutorial

  • GDI+ problem (tough!)
    R r9

    Hi Shree Can you give an example?

    C# graphics help winforms question

  • GDI+ problem (tough!)
    R r9

    correction: if 50%, then only 50% of the drawing must be filled with the color.

    C# graphics help winforms question

  • GDI+ problem (tough!)
    R r9

    I have this drawing: private System.Drawing.Graphics graphicsObj = null; private System.Drawing.Pen penBlackWidth1 = new System.Drawing.Pen(System.Drawing.Color.Black,1); private Point[] curvePoints = null; private SolidBrush lightGrayBrush = new SolidBrush(Color.LightGray); private Point point1; private Point point2; private Point point3; private Point point4; private SolidBrush blackBrush = new SolidBrush(Color.Black); ................................................... try { graphicsObj = e.Graphics; graphicsObj.DrawLine(penBlackWidth1, 45, 20, 175, 20); graphicsObj.DrawLine(penBlackWidth1, 45, 20, 45, 120); graphicsObj.DrawLine(penBlackWidth1, 175, 20, 175, 120); graphicsObj.DrawLine(penBlackWidth1, 45,120,90,160); graphicsObj.DrawLine(penBlackWidth1, 175, 120, 135, 160); graphicsObj.DrawLine(penBlackWidth1, 90, 160, 135, 160); graphicsObj.DrawLine(penBlackWidth1, 465, 335, 490, 335); graphicsObj.DrawLine(penBlackWidth1, 580, 335, 605, 335); graphicsObj.DrawLine(penBlackWidth1, 465, 335, 490, 335); graphicsObj.DrawLine(penBlackWidth1, 580, 335, 605, 335); graphicsObj.DrawLine(penBlackWidth1, 473, 345, 483, 345); graphicsObj.DrawLine(penBlackWidth1, 473, 345, 478, 335); graphicsObj.DrawLine(penBlackWidth1, 483, 345, 478, 335); graphicsObj.DrawLine(penBlackWidth1, 587, 345, 597, 345); graphicsObj.DrawLine(penBlackWidth1, 587, 345, 592, 335); graphicsObj.DrawLine(penBlackWidth1, 597, 345, 592, 335); point1 = new Point(592,335); point2 = new Point(597,345); point3 = new Point(587,345); point4 = new Point(592,335); curvePoints = new Point[] { point1,point2, point3, point4 }; graphicsObj.FillPolygon(blackBrush, curvePoints, FillMode.Alternate); point1 = new Point(478,335); point2 = new Point(483,345); point3 = new Point(473,345); point4 = new Point(478,335); curvePoints = new Point[] { point1,point2, point3, point4 }; graphicsObj.FillPolygon(blackBrush, curvePoints, FillMode.Alternate); } catch (Exception ex) { MessageBox.Show(ex.Message); } I want to fill the drawing with a color. From buttom to top. BUT the drawing must be filled accourding to a percent. Is 50%, then only 50% of the drawing must be filled with the color. Natural the fill must newer come outside the drawings edge. Any help? Thank

    C# graphics help winforms question

  • MDI problem
    R r9

    I have some Mdiclient who's windowsState is "Maximized" and where minimumBox and maximumBox is set to false. ControlBox is set to false. FormBorderStyle is "FixedToolWindow". But still there is 3 icons in top right, when the mdiClient is Maximized.... And there is also a restore icon in top left. How do I remove these icons, so that my MdiClient always is Maximized?? See: http://csharp.users.whitehat.dk/mdi.jpg Thanks

    C# question csharp help

  • ToolTip on GDI+ figure
    R r9

    I have a pictureBox on my Form. Then I use the graphics object from the PictureBox_paint event: .. graphicsObj = e.Graphics; ..

    C# graphics winforms question

  • ToolTip on GDI+ figure
    R r9

    You are genius :-) With all your help, I am getting better and better at understanding GDI+. Thanks

    C# graphics winforms question

  • ToolTip on GDI+ figure
    R r9

    It is possible to put a tooltip on a GDI+ figure? (on mouseOver) The tooltip1.SetToolTip() method takes in a System.WindowsForms.Control, but there is no overload for a GDI drawing ?

    C# graphics winforms question

  • GDI+ FillPolygon
    R r9

    WiB: Is it possible to make the mouse cursor = Cursors.Hand if the the user point the mouse inside my figure ? formGraphics.DrawLine(myPen, 4, 4, 50, 4); formGraphics.DrawLine(myPen, 4, 4, 4, 100); formGraphics.DrawLine(myPen, 50, 4, 50, 100); formGraphics.DrawLine(myPen, 4, 100, 27, 120); formGraphics.DrawLine(myPen, 50, 100, 27, 120);

    C# graphics winforms tutorial question

  • GDI+ FillPolygon
    R r9

    Thanks again

    C# graphics winforms tutorial question

  • GDI+ FillPolygon
    R r9

    WiB: Thanks. It works perfekt. How do you know in which order to put the Points?? Eks: Point[] points = { new Point(4, 4), new Point(50, 4), new Point(50, 100), new Point(27, 120), new Point(4, 4), new Point(4, 100)}; Won't fill the figure correkt.

    C# graphics winforms tutorial question

  • GDI+ FillPolygon
    R r9

    Can anyone show me how to fill this figure with a blue color? System.Drawing.Graphics formGraphics = null; System.Drawing.Pen myPen; formGraphics = pictureBox7.CreateGraphics(); myPen = new System.Drawing.Pen(System.Drawing.Color.Black,1); formGraphics.DrawLine(myPen, 4, 4, 50, 4); formGraphics.DrawLine(myPen, 4, 4, 4, 100); formGraphics.DrawLine(myPen, 50, 4, 50, 100); formGraphics.DrawLine(myPen, 4, 100, 27, 120); formGraphics.DrawLine(myPen, 50, 100, 27, 120); Maybe with the FillPolygon method.

    C# graphics winforms tutorial question

  • GDI+ help
    R r9

    jdunlap: You can email me the code on: java2@mail.dk Thanks

    C# winforms graphics help tutorial question

  • FillPolygon problem?
    R r9

    I have a figure that I want to fill with black color, but it don't work!! private void button11_Click(object sender, System.EventArgs e) { System.Drawing.Graphics formGraphics = null; System.Drawing.Pen myPen; formGraphics = pictureBox7.CreateGraphics(); myPen = new System.Drawing.Pen(System.Drawing.Color.Black,1); formGraphics.DrawLine(myPen, 4, 4, 50, 4); formGraphics.DrawLine(myPen, 4, 4, 4, 100); formGraphics.DrawLine(myPen, 50, 4, 50, 100); formGraphics.DrawLine(myPen, 4, 100, 27, 120); formGraphics.DrawLine(myPen, 50, 100, 27, 120); SolidBrush Brush = new SolidBrush(Color.Black); Point point1 = new Point(4, 4); Point point2 = new Point(50, 4); Point point3 = new Point(4, 4); Point point4 = new Point(4, 100); Point point5 = new Point(50, 4); Point point6 = new Point(50, 100); Point point7 = new Point(4, 100); Point point8 = new Point(27, 120); Point point9 = new Point(50, 100); Point point10 = new Point(27, 120); Point[] curvePoints = new Point[] { point1, point2, point3, point4, point5, point6, point7, point8, point9, point10, }; formGraphics.FillPolygon(Brush, curvePoints); myPen.Dispose(); formGraphics.Dispose(); } Any idea?

    C# graphics help question

  • GDI+ help
    R r9

    jdunlap: Can you show me the code for a raised / sunken rectangle?

    C# winforms graphics help tutorial question

  • GDI+ help
    R r9

    I need something like this: System.Drawing.Graphics formGraphics = null; System.Drawing.Pen myPen; formGraphics = pictureBox1.CreateGraphics(); myPen = new System.Drawing.Pen(System.Drawing.Color.Black,1); formGraphics.DrawLine(myPen, 5, 5, 105, 5); formGraphics.DrawLine(myPen, 15, 35, 95, 35); formGraphics.DrawLine(myPen, 5, 5, 15, 35); formGraphics.DrawLine(myPen, 105, 5, 95, 35); SolidBrush darkGrayBrush = new SolidBrush(Color.Gray); Point point1 = new Point(5, 5); Point point2 = new Point(105, 5); Point point3 = new Point(15, 35); Point point4 = new Point(95, 35); Point point5 = new Point(5, 5); Point point6 = new Point(15, 35); Point point7 = new Point(105, 5); Point point8 = new Point(95, 35); Point[] curvePoints = new Point[] { point1, point2, point3, point4, point5, point6, point7, point8 }; formGraphics.FillPolygon(darkGrayBrush, curvePoints); but just raised, lower and clickable. How?

    C# winforms graphics help tutorial question

  • GDI+ help
    R r9

    Can someone show me how to draw a raised rectangle on a form using GDI+ ? When the user click the rectangle, then it must be lower. KeyDown = lower; KeyUp = raised; Thanks

    C# winforms graphics help tutorial 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