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
  1. Home
  2. General Programming
  3. C#
  4. draw problem

draw problem

Scheduled Pinned Locked Moved C#
graphicscsharpdotnetlinqhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    om_metab
    wrote on last edited by
    #1

    I have problem with this code is draw ships many time if u have any idea about it using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Diagnostics; using System.Text; using System.Windows.Forms; namespace DrawingGeomerticShips { public partial class Form1 : System.Windows.Forms.Form { private Pen nPen; public Form1():base() { InitializeComponent(); nPen = new Pen(Color.Black); } protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); } //private Bitmap ColorMap; public enum dModes : int { Line, Rectangle, Ellipse, Brush, Path, Text, Eraser } //private Bitmap bmp; private Bitmap bmp2; private Graphics g2; private Color clr= Color.Red; //private Color clr2 = Color.blue; private int StartX; private int StartY; private int EndX; private int EndY; private int BoxWidth; private int BoxHeight; private System.Drawing.Drawing2D.GraphicsPath mpath = new System.Drawing.Drawing2D.GraphicsPath(); private dModes dmode; private int xLoc; private int yLoc; //private dStyles dstyle = dStyles.Outline; private Int16 pWidth = 1; //private Cursor c = new Cursor(GetEmbeddedFile("Whiteboard.ColorPicker.ico")); //private Cursor er = new Cursor(GetEmbeddedFile("Whiteboard.Eraser.ico")); private bool isDraw; private PointF pF; private PointF pFOld; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="HideCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)] public static extern Int32 HideCaret(Int32 hwnd); private bool allow; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="ShowCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)] public static extern Int32 ShowCaret(Int32 hwnd); [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="CreateCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLast

    L L 2 Replies Last reply
    0
    • O om_metab

      I have problem with this code is draw ships many time if u have any idea about it using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Diagnostics; using System.Text; using System.Windows.Forms; namespace DrawingGeomerticShips { public partial class Form1 : System.Windows.Forms.Form { private Pen nPen; public Form1():base() { InitializeComponent(); nPen = new Pen(Color.Black); } protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); } //private Bitmap ColorMap; public enum dModes : int { Line, Rectangle, Ellipse, Brush, Path, Text, Eraser } //private Bitmap bmp; private Bitmap bmp2; private Graphics g2; private Color clr= Color.Red; //private Color clr2 = Color.blue; private int StartX; private int StartY; private int EndX; private int EndY; private int BoxWidth; private int BoxHeight; private System.Drawing.Drawing2D.GraphicsPath mpath = new System.Drawing.Drawing2D.GraphicsPath(); private dModes dmode; private int xLoc; private int yLoc; //private dStyles dstyle = dStyles.Outline; private Int16 pWidth = 1; //private Cursor c = new Cursor(GetEmbeddedFile("Whiteboard.ColorPicker.ico")); //private Cursor er = new Cursor(GetEmbeddedFile("Whiteboard.Eraser.ico")); private bool isDraw; private PointF pF; private PointF pFOld; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="HideCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)] public static extern Int32 HideCaret(Int32 hwnd); private bool allow; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="ShowCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)] public static extern Int32 ShowCaret(Int32 hwnd); [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="CreateCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLast

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This is totally unreadable; put your code between <pre></pre> tags, and mark the lines that have the problem.

      I must get a clever new signature for 2011.

      1 Reply Last reply
      0
      • O om_metab

        I have problem with this code is draw ships many time if u have any idea about it using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Diagnostics; using System.Text; using System.Windows.Forms; namespace DrawingGeomerticShips { public partial class Form1 : System.Windows.Forms.Form { private Pen nPen; public Form1():base() { InitializeComponent(); nPen = new Pen(Color.Black); } protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); } //private Bitmap ColorMap; public enum dModes : int { Line, Rectangle, Ellipse, Brush, Path, Text, Eraser } //private Bitmap bmp; private Bitmap bmp2; private Graphics g2; private Color clr= Color.Red; //private Color clr2 = Color.blue; private int StartX; private int StartY; private int EndX; private int EndY; private int BoxWidth; private int BoxHeight; private System.Drawing.Drawing2D.GraphicsPath mpath = new System.Drawing.Drawing2D.GraphicsPath(); private dModes dmode; private int xLoc; private int yLoc; //private dStyles dstyle = dStyles.Outline; private Int16 pWidth = 1; //private Cursor c = new Cursor(GetEmbeddedFile("Whiteboard.ColorPicker.ico")); //private Cursor er = new Cursor(GetEmbeddedFile("Whiteboard.Eraser.ico")); private bool isDraw; private PointF pF; private PointF pFOld; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="HideCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)] public static extern Int32 HideCaret(Int32 hwnd); private bool allow; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="ShowCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)] public static extern Int32 ShowCaret(Int32 hwnd); [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="CreateCaret", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLast

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        That is unformatted and unreadable. I think I saw some CreateGraphics which is probably very wrong. Please edit your question to include PRE tags, then read this[^]. :)

        Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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