Click here to Skip to main content
15,890,609 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Fill Treeview using recursion Pin
sterenas11-Dec-18 5:34
sterenas11-Dec-18 5:34 
GeneralRe: Fill Treeview using recursion Pin
Eddy Vluggen11-Dec-18 6:16
professionalEddy Vluggen11-Dec-18 6:16 
GeneralRe: Fill Treeview using recursion Pin
sterenas11-Dec-18 7:51
sterenas11-Dec-18 7:51 
GeneralRe: Fill Treeview using recursion Pin
Eddy Vluggen11-Dec-18 23:10
professionalEddy Vluggen11-Dec-18 23:10 
Questionentity framework Group by multiple columns and count the number of groups with more than 1 item Pin
desanti6-Dec-18 11:24
desanti6-Dec-18 11:24 
AnswerRe: entity framework Group by multiple columns and count the number of groups with more than 1 item Pin
Richard Deeming7-Dec-18 7:46
mveRichard Deeming7-Dec-18 7:46 
QuestionProblems with Entity Famework and bindingsources Pin
desanti6-Dec-18 0:13
desanti6-Dec-18 0:13 
QuestionDrawlines is correct or not ? Pin
Coffee_Break5-Dec-18 1:27
Coffee_Break5-Dec-18 1:27 
The drawlines feature does not work correctly in the following codes. but it works correctly when the same data is drawn with the drawline. Drawlines draws lines that are not real. What are your comments?
VB
Dim uImage As Bitmap = New Bitmap(PictureBox1.Size.Width, PictureBox1.Size.Height, 4, Imaging.PixelFormat.Format32bppPArgb, 0)

   Dim Grafik As Graphics = Graphics.FromImage(uImage)

   Grafik.Clear(Color.Black)

   Dim Offset As Integer = 0
   Dim Gain As Integer = 1
   Dim Freq As Integer = 1
   Dim N As Integer = PictureBox1.Size.Width

   Dim D(N - 1) as PointF

    ' Create Data
    '
    For i As Integer = 0 To N - 1
        D(i).X = i
        D(i).Y = Offset + Gain * Math.Cos(i * Freq * Math.PI / 180.0)
    Next

   ' Scale for drawing
   '
   Dim sx As Double = PictureBox1.Size.Width / (N - 1)
   Dim sy As Double = PictureBox1.Size.Height * 0.5

   ' increase gain
   '
   sy=sy*32000

   ' Data to Pixel
   '
   For i As Integer = 0 To N - 1
       D(i).X = D(i).X * sx
       D(i).Y = PictureBox1.Size.Height * 0.5 - D(i).Y * sy
   Next

    ' DrawLines is not correct
    '
    Grafik.DrawLines(New Pen(Color.Blue), D)

   ' DrawLine is correct
   '
    For i As Integer = 1 To N - 1
        Grafik.DrawLine(New Pen(Color.Red), D(i - 1), D(i))
    Next

    PictureBox1.Image = Nothing
    PictureBox1.Image = uImage

    Grafik.Dispose()

I would like to provide additional information. Errors may occur when Picturebox reaches a specific size. The dimensions for this example are 720; 530 pixels. the following image is being obtained:
Blue lines should not appear in the image. Should overlap with the red lines.
https://i.hizliresim.com/MVXM2g.png[^]
AnswerRe: Drawlines is correct or not ? Pin
Eddy Vluggen5-Dec-18 2:05
professionalEddy Vluggen5-Dec-18 2:05 
Questionsave my excel invoice in excel sheet Pin
kami1244-Dec-18 8:04
kami1244-Dec-18 8:04 
QuestionRe: save my excel invoice in excel sheet Pin
Richard MacCutchan4-Dec-18 8:58
mveRichard MacCutchan4-Dec-18 8:58 
QuestionError ContextSwitchDeadlock Pin
desanti4-Dec-18 5:33
desanti4-Dec-18 5:33 
AnswerRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen4-Dec-18 6:33
professionalEddy Vluggen4-Dec-18 6:33 
GeneralRe: Error ContextSwitchDeadlock Pin
desanti4-Dec-18 8:45
desanti4-Dec-18 8:45 
GeneralRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen4-Dec-18 9:37
professionalEddy Vluggen4-Dec-18 9:37 
GeneralRe: Error ContextSwitchDeadlock Pin
desanti5-Dec-18 1:18
desanti5-Dec-18 1:18 
GeneralRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen5-Dec-18 1:43
professionalEddy Vluggen5-Dec-18 1:43 
GeneralRe: Error ContextSwitchDeadlock Pin
desanti5-Dec-18 2:08
desanti5-Dec-18 2:08 
GeneralRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen5-Dec-18 2:37
professionalEddy Vluggen5-Dec-18 2:37 
GeneralRe: Error ContextSwitchDeadlock Pin
desanti5-Dec-18 2:49
desanti5-Dec-18 2:49 
GeneralRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen5-Dec-18 2:52
professionalEddy Vluggen5-Dec-18 2:52 
GeneralRe: Error ContextSwitchDeadlock Pin
desanti5-Dec-18 2:59
desanti5-Dec-18 2:59 
GeneralRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen5-Dec-18 3:01
professionalEddy Vluggen5-Dec-18 3:01 
GeneralRe: Error ContextSwitchDeadlock Pin
desanti5-Dec-18 3:05
desanti5-Dec-18 3:05 
GeneralRe: Error ContextSwitchDeadlock Pin
Eddy Vluggen5-Dec-18 3:09
professionalEddy Vluggen5-Dec-18 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.