-
Scaling problems using API Graphics
I use the following code to create polygons in a picture object,
hBrush = CreateSolidBrush(CheckSysColor(m_FillColor))
oldBrush = SelectObject(m_hDC, hBrush)
Call BeginPath(m_hDC)
Call Polyline(m_hDC, PolyPts(0), UBound(PolyPts) + 1)
Call EndPath(m_hDC)
If m_Filled And m_Outlined Then
Call StrokeAndFillPath(m_hDC)
ElseIf m_Filled Then
Call FillPath(m_hDC)
ElseIf m_Outlined Then
Call StrokePath(m_hDC)
End If
Call SelectObject(m_hDC, oldBrush)
Call DeleteObject(hBrush)
Where polypts() is a pointAPI type array containing coordinates to draw the
points.
But when I scale the picture using picture1.scale (x1,y1) - (x2,y2)
and try to draw the polygon to the window scale, the resultant polygon isn't
drawn to
the correct scale.
I've tried the .scaleX .scaleY methods but they don't seem to work either:
With Picture1
PolyPts(0).X = .ScaleX(x3, .ScaleMode, vbTwips)
End with
Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks