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
I

ianhunt01

@ianhunt01
About
Posts
15
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Drawing a big image to real coordinates
    I ianhunt01

    Awesome, Thanks a lot - the whole matrix issue was a bit daunting but it makes more sense now. I will dig in right now and try it out. cheers Ian

    C# graphics help

  • Drawing a big image to real coordinates
    I ianhunt01

    Yes, (I mean yes, I want to loose the precision in order to know where he is) I need to get the user to select an area he wants to zoom into with the mouse. I want to get the e.X and e.Y of the beginning and end of his zoom and redraw the image meaning i have to move and scale the image with this new info. I checked later and saw that the image has a resolution of 6500 x 6500 although it covers and area of 25 kilometers by 25 kilometers. Does this help ? Ian

    C# graphics help

  • Drawing a big topographic map in its own coordinates
    I ianhunt01

    Hi, I have got a big topographical jpg file that I want to display in a form on a picturebox in its real coordinates that ranges X from 50 000 to 75 000 and Y from 2 800 000 to 2 825 000. this will make it very easy for me to get the mouse coords in real coords as the user invokes the Mousedown event. It will also make it easier for me to draw real features in its real coordinates. I have got the code:

    Image image = Image.FromFile(@"C:\Images\2529DA.jpg");
    Pen myPen = new Pen(Color.Black);
    Graphics formGraphics = this.picGrid.CreateGraphics();
    formGraphics.Clear(picGrid.BackColor);formGraphics.DrawImage(image,0,0,1000, 1000);

    This shows the topomap nicely on the screen but with the local picturebox coords from 0 to 1000. If I change the code to

    formGraphics.DrawImage(image, 50000, 2800000, 25000, 25000);

    This previous code then puts the map WAY offscreen to the south-east ! I tried fiddling with the following code but no luck.

    formGraphics.DrawImageUnscaledimage,0,0);
    formGraphics.DrawImageUnscaledAndClipped(image, rect1);

    please help ! Thanks Ian

    Graphics graphics help

  • Drawing a big image to real coordinates
    I ianhunt01

    Hi, I have got a big topographical jpg file that I want to display in a form on a picturebox in its real coordinates that ranges X from 50 000 to 75 000 and Y from 2 800 000 to 2 825 000. this will make it very easy for me to get the mouse coords in real coords as the user invokes the Mousedown event. It will also make it easier for me to draw real features in its real coordinates. I have got the code:

    Image image = Image.FromFile(@"C:\Images\2529DA.jpg");
    Pen myPen = new Pen(Color.Black);
    Graphics formGraphics = this.picGrid.CreateGraphics();
    formGraphics.Clear(picGrid.BackColor);

    formGraphics.DrawImage(image, 0, 0, 1000, 1000);

    This shows the topomap nicely on the screen but with the local picturebox coords from 0 to 1000. If I change the code to

    formGraphics.DrawImage(image, 50000, 2800000, 25000, 25000);

    This previous code then puts the map WAY offscreen to the south-east ! I tried fiddling with the following code but no luck.

    formGraphics.DrawImageUnscaled(image,0, 0);
    formGraphics.DrawImageUnscaledAndClipped(image, rect1);

    please help ! cheers Ian

    C# graphics help

  • muliple class problem
    I ianhunt01

    Hi, I had the same question here with no positive answers and did a lot of reading finding the answer in Delegates and Event handling - do a search in the articles in Delegates and Event handling. It ends up a long and tedious process of three pages of coding to fix. I got fed up and just posted the variables as public static and then everything can see it allways. Very crude and non conforming to OOP, but quick !! cheers Ian

    C# data-structures help question

  • Reading more than column in a text file
    I ianhunt01

    Hi, I am used to VB6 reading a few header items below each other out of a text file followed by some columns of data such as:

    fh1 = FreeFile
    Open inPath For Input As #fh1
    Input #fh1, projfile.name
    Input #fh1, projfile.projdate
    Input #fh1, projfile.version

    For X = 1 To intNumVars
        Input #fh1, Bas(X).name, Bas(X).Min, Bas(X).Max, Bas(X).ave,
    Next X
    

    Close(fh1)

    I have been through a lot of material on StreamReader, BinaryReader etc and getting stuck. Any help (code examples) or pointers to articles, chapters would be much appreciated. The writing of the info to the file seems easy with :

    StreamWriter outFS = new StreamWriter(new FileStream(outFile, FileMode.OpenOrCreate, FileAccess.Write));
    outFS.WriteLine(strModelDesc1);
    outFS.WriteLine(strModelDesc2);
    outFS.WriteLine("{0},{1},{2}"intLayers, intStats, decAve);
    outFS.Close();

    thanks Ian

    C# help announcement

  • Passing data between parent, child and class
    I ianhunt01

    Howdey, I have been digging into the issue of delegates and tried to implement http://www.colinmackay.net/Articles/PassingValuesBetweenFormsinNET/tabid/58/Default.aspx[^] but I am missing something. Background, I have got a parent "frmMDI" who creates a new instance of class ReadModel readMdl = new ReadModel;"

    class ReadModel
    {
        private string strModelDesc1 = "Model";
        private int intNLAY = 1;
    
        public bool SaveModelData(string strOpenFile)
        {
            etc
            etc
        }
    
        public string inModel
        {
            get
            {
                return strModelDesc1;
            }
            set
            {
                strModelDesc1 = value;
            }
        }
    
    }
    

    Then the frmMDI calls a new instance of a child frmData that has textboxes etc allowing the user to give new values for strModelDesc1 and intNLAY. This must then be saved later to a file. The problem that I have is setting the new values from the user on frmData back to the specific instance of class readMdl in frmMDI so that that specific instance of SaveModelData can save to a file and other classes can use it later on by reading readMdl.inModel etc. I can still get the info from the child (while it is open) get and set blocks but once it is closed then it is lost. thanks for the patience Ian I could use static variables all the way but that would be stupid.

    C# help csharp

  • MDI; Finding a property on parent from MDI child form
    I ianhunt01

    Thanks Mark, The book looks good and I will amazon it soon !! Cheers Ian

    C# help tutorial

  • MDI; Finding a property on parent from MDI child form
    I ianhunt01

    Thanks Mark, This was really helpfull !! I used to work in VB6 Pro and thought about moving over to C#.Net instead of VB.Net. In order to learn the new C#.Net environment it seems you have to buy a lot of books (four up to date) and do the Microsoft certified courses and still all of it only shows you bits and pieces and end up becoming very expensive. So what I am trying to say is that the code you supplied helps me a lot in grasping whats happening. So thanks again for your patience. Ian

    C# help tutorial

  • How can I get input from 2 forms?
    I ianhunt01

    The link "Here" leads nowhere ?

    C# question

  • MDI; Finding a property on parent from MDI child form
    I ianhunt01

    Thanks Mark, Nice app and very usefull info for something else that I want to do but no MDI stuff in there ? cheers Ian

    C# help tutorial

  • MDI; Finding a property on parent from MDI child form
    I ianhunt01

    No, I had a look at the Wiki and it does not tell me much in a practical way of achieving this. But thanks in any case Ian

    C# help tutorial

  • MDI; Finding a property on parent from MDI child form
    I ianhunt01

    Hi, I have got a MDI app where one of the childforms must be able to see the status of a RadioButton on a docked panel on the MDI from. I want too use the mousedown event on a child frmShow to draw lines on the form if the radPoly was clicked on the pnlTools on the parent MDI form. Please help with a simple code example. Thanks Ian

    C# help tutorial

  • MDI children instances, how to code
    I ianhunt01

    Thanks Dave, It works !! Do you know of a good reference on more MDI topics ? A step by step guide to get abit more out of my MDI code ! cheers Ian

    C# css tools help tutorial question

  • MDI children instances, how to code
    I ianhunt01

    Hi, I have trouble trying to find out which instance of a MDI child is active and how to adress it's properties and methods. I have got a MDI form with child frmList that shows all the available info in a particular case, then clicking on one of the nodes should pop up an frmShow that displays the info in a grid on a background image. Adding to this is a from frmProperties with certain tools that should depict what the user can do on the frmShow window (Be it zooming in, adding lines etc). The problem is that there must allways just be one instance of frmList and frmProperties but multiple instances of frmShow. I think I have it sorted with: (make suggestions please !)

            bool isOpen = false;
           // loop through list and find if child is open
           // 
            for (int x = 0; x < this.MdiChildren.Length; x++)
            {
                if (this.MdiChildren\[x\].Name == "frmListDef")
                {
                    isOpen = true;
                }
            }
           // if it does not exist open it
            if (!isOpen)
            {
                Form frmList = new frmListDef();
                frmList.MdiParent = this;
                frmList.Show();
            }
    

    Now I am trying to find out how to adress a method or property on the specific instance of a child ? thanks Ian PS: any nice articles or refs to MDI programming would be nice

    C# css tools 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