Hi ! everyones I'm using vb5
Here is my problem
I've made a program that load a big scanned image like 9600 x 7200 pixels
into a picturebox i need to draw lines and textboxes create at runtime over the picture
everything work fine for picture like 4800 x 3600 pixels which is the halfsize of the picture mentioned above.
I'm wondering if there is any limitations for the size of an image load into a picture box.
The definition of the error message is:Visual Basic can't create a persistent bitmap for automatic redraw of the form or picture. This error has the following cause and solution:
· There isn't enough available memory for the AutoRedraw property to be set to True.
Set the AutoRedraw property to False and perform your own redraw in the Paint event procedure or make the PictureBox control or Form object smaller and try the operation again with AutoRedraw set to True.
""The following is where the event to draw lines and textboxes is triggered""Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If dimrefcheck = False Then
If Clk1% = 0 Then check if it's the first click
Clk1% = 1
FrstX! = X
FrstY! = Y
Text2.Text = ""
Picture1.Circle (FrstX!, FrstY!), 10, RGB(255, 0, 0)
showrubber = True
Else
Clk1% = 0
Course% = (CourseHeading(FrstX!, FrstY!, X, Y, FullHeading#, Distance!))
Text2.Text = Format(CStr(Distance!), "###0.00")
Picture1.AutoRedraw = True
Picture1.Circle (X, Y), 10, RGB(255, 0, 0)
Picture1.Line (FrstX!, FrstY!)-(X, Y), vbRed
trouve_midpoint FrstX!, X, FrstY!, Y
i = i + 1
Load lbldim(i)
Set lbldim(i).Container = Picture1
lbldim(i).BorderStyle = 1
lbldim(i).Visible = True
lbldim(i).Caption = "Réf: " & ref 'Format(Text1.Text / Text2.Text * Text3.Text, "###0.00")
lbldim(i).Top = midpointy
lbldim(i).Left = midpointx
showrubber = False
dimrefcheck = True
End If
Else
If Clk1% = 0 Then
Clk1% = 1 'verifie si c'est le premier clic de 2iem reference
FrstX! = X
FrstY! = Y
Text3.Text = ""
Picture1.Circle (FrstX!, FrstY!), 2.5, RGB(0, 255, 0)
trouve_midpoint FrstX!, X, FrstY!, Y
i = i + 1
Load lbldim(i)
Set lbldim(i).Container = Picture1
showrubber = True
Else
Clk1% = 0
Course% = (CourseHeading(FrstX!, FrstY!, X, Y, FullHeading#, Distance!))
Text3.Text = Format(CStr(Distance!), "###0.00")
'Picture1.FillStyle = 1
'Picture1.AutoRedraw = False
Picture1.Circle (X, Y), 2.5, RGB(0, 255, 0)
Picture1.Line (x1, y1)-(x2, y2)
Picture1.Line (FrstX!, FrstY!)-(X, Y), vbMagenta
If CHKDIM.Value = 1 Then
trouve_midpoint FrstX!, X, FrstY!, Y
i = i + 1
Load lbldim(i)
Set lbldim(i).Container = Picture1
lbldim(i).BorderStyle = 1
lbldim(i).Visible = True
lbldim(i).Caption = Format(Text1.Text / Text2.Text * Text3.Text, "###0.00")
lbldim(i).Top = midpointy
lbldim(i).Left = midpointx
showrubber = False
Picture1.AutoRedraw = True ' Here is the place where the autoredraw suck!
Else
Picture1.AutoRedraw = True
showrubber = False
refreshdim
End If
End If
End If
xs = X: ys = Y 'Rectangle start position
xl = X: yl = Y 'Rectangle Last position
End Sub
Thank's to anyone that have an idea to solve this, help would be greatly appreciate.
Georges.
Enter your message below
Sign in or Join us (it's free).