Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Circle Method failure

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I've got a strange problem with drawing circles.
Details are in the souce code shown below.
(Using VB Pro 6 on a win98 second edition box)

Any help would be very much appreciated.

Cheers,

David


*Source Code to reproduce problem*

Private Sub Form_Load()

ScaleMode = vbPixels
Circle (4226, 1383), 4087 ' succeeds
Circle (4226, 1383), 4088 ' fails silently


' coordinates of bounding box (of failing method) are
' as follows:
' left = 138
' right = 8314
' top = -2705
' bottom = 5471

' according to MS platform SDK documentation on
' ellipse() and arc() functions
' these limitations exist under Win95/98:
' left + right <= 32767
' top + bottom <= 32767
' left + right + top + bottom <= 32767

' the above bounding box clearly fits within these
' limitations
' so what is the problem?
' NB this also fails directly calling the arc() api
' function from vb as well

' I need to be able to know exactly what causes this,
' so I can trap for it. since occasionally a GPF occurs
' in GDI.EXE when this happens.

End Sub
 
Hi dcpurton,

I tried your code in my VB60 (winNT), and with the forms autoredraw property set to true both circles works fine.

Sunaj
 
That makes sense, as I'm fairly sure that this is a 16bit win95/98 thing. NT uses a 32bit coordinate system so these coords should be nowhere near its limits.

For now I'm just not letting it draw circles any bigger than this radius - but this is dodgy since I can't say for certain *why* this fails (under at least two boxen running win95 and 98). I can also reproduce the problem in C, so either the SDK documentation is up the creek or I'm missing something important.

Can't be helped :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top