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

RyanSmith

@RyanSmith
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to draw simple sphere and lines in 3D space ?
    R RyanSmith

    Hi, I've spent the last few days looking at approaches to creating a 3D display of data points (as a small sphere) and lines (linking the spheres & as a co-ordinate axis). I did think that DirectX was the solution, but it appears to be not supported for VB.NET under the V4 .NET Framework (?). So I have installed XNA v4.0 as this seems to be the 'new' way of performing 3D graphics. My goal is to have a form with a picturebox or appropriate control that I can write "data points" on to in a 3D space. I also want the user to be able to zoom and pan to view the data. I have had no luck finding straight forward examples in VB (I'm not a c# guy). I have found examples that write circles and lines to a 2D space using XNA but nothing more complex than that. I would really appreciate any suggestions on where to find a good VB.NET resource for XNA. A post of some sample code would be even better ! Thanks in advance. Regards RS

    Visual Basic csharp graphics dotnet game-dev

  • Drawing on a PictureBox
    R RyanSmith

    Thanks Luc, The physical description "glass plate" you described has reinforced my own interpretation of how this PB works. The .Refresh() helped too. I suspect you would not choose a PB to do this task ? Thanks again. Ryan

    Visual Basic graphics help csharp question

  • Database Field to contain data from a screen table
    R RyanSmith

    I have written a small medical research application is asp that uses a sqlserver database to store data patient research data. To set the scene for my question; I am not sure what the term of the table/field design I have used is but I will try to explain. I have a table that I have called ref_FieldDefinition, this contains the definition of each data field I need to store patient research data for. (E.g. FieldUID, FieldLabel, FieldType, etc.). So I could define a field for example FieldLabel ="Smoker", with FieldType="T/F". I then have a seperate table that stores the data for each defined field , data_PatientData, (PatientUID, FieldUID, StoredData). (This is a simplified description of how I am constructing the db). When I present a user with an asp page for a particular patient, the page is built based on which fields are defined in the ref_FieldDefinition table and then which data is applicable from the data_PatientData table. Hence, I have no hard wired fields in my table design. This concept works fine for classic database field definitions, where you have a fields label and a field data input object (like a textbox, dropdown, checkbox, etc). Yesterday I was asked could I create a 3x3 "table" on the screen for users to enter values into. The first two rows of the table will contain numbers and the bottom row will contain the sum of each column. If I had a classic db table design I could hardwire fields like "topleft", "topmiddle", "topright" etc. I was hoping to do this in a smarter way and somehow define a "table" type field that I could dynamically build on display, as I do with my other field definition. Am I aiming too high here ? Does anyone have any thoughts on this ? Some brainstorming would be much appreciated. Cheers Ryan

    Database database question design tutorial discussion

  • Drawing on a PictureBox
    R RyanSmith

    Thanks for the example Luc. Unfortunately, I am still not clear with my example if I have to redraw the image when I want to remove the graphics I have drawn ? Or can I clear the graphics without effecting the image below ? Cheers Ryan

    Visual Basic graphics help csharp question

  • Drawing on a PictureBox
    R RyanSmith

    Hi, I have switched to .NET only recently and I am having some trouble with the picturebox and drawing on it over an image. The aim is to have a picturebox with an image, then using a checkbox, be able to show and hide graphics over the image. In this case I am trying to draw a crosshair at the centre of the image. The examples I have come across on the web have been minimal help. I am also unclear about the paint event for the picturebox and the form. I suspect I should be calling the draw the crosshair sub in one or both of these events ... as well as in the checkbox event? I have created a simple, to show my problem. My hope is someone can set me straight here. Below is the code from my sample form.

    Public Class Form1

    Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'LOAD A IMAGE INTO THE PICTUREBOX
        PictureBox1.Load("SampleImage.jpg")
    End Sub
    
    Private Sub CheckBox1\_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            'Show the Cental Crosshair
            DisplayCentralXhair()
        Else
            'Do not show (erase?) the Central Crosshair
            RemoveCentralXhair()
        End If
    End Sub
    
    Private Sub DisplayCentralXhair()
        Dim mypen As Pen
        Dim aGraphics As Graphics
    
        mypen = New Pen(Color.Red, 1)
        aGraphics = PictureBox1.CreateGraphics()
    
        aGraphics.DrawLine(mypen, 182, 137 - 5, 182, 137 + 5)
        aGraphics.DrawLine(mypen, 182 - 5, 137, 182 + 5, 137)
    
    End Sub
    
    Private Sub RemoveCentralXhair()
        'Can I clear the Graphics drawn on the picturebox and retain the image below ?
        'Do I have to reload the image ?
    
    End Sub
    

    End Class

    Visual Basic graphics help csharp 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