By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

GDI+ New Matrix() generates Out Of Mem Exception

P: n/a
The following code, copied from MSDN article "Using Matrix Transformation in
System.Drawing" creates an OutOfMemoryException when creating the Matrix.

The downloaded MSDN source code works fine.

Any ideas please? Thanks a lot!
Herbert
Imports System.Drawing.Drawing2D

Public Class Form1
Inherits System.Windows.Forms.Form

'define the application coordinate range
Private mMinX As Double = -5.0
Private mMaxX As Double = -5.0
Private mMinY As Double = mMinX
Private mMaxY As Double = mMaxX

#Region " Vom Windows Form Designer generierter Code "

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'create the transformation axis using a rectangle (sized in
application coordinates) and
'three points in device coordinates (pixels).
Dim rectPlotF = New RectangleF _
(mMinX, mMaxY, (mMaxX - mMinX), -(mMaxY - mMinY))

Dim bmpcorners(2) As PointF
bmpcorners(0) = New PointF(0, 0)
bmpcorners(1) = New PointF(Me.Width, 0)
bmpcorners(2) = New PointF(0, Me.Height)

' the graphic object will now implicitly convert (x,y)
' to pixel coordinates
Dim mTransform As Matrix
mTransform = New Matrix(rectPlotF, bmpcorners) 'create
transformation matrix

End Sub
End Class
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry folks, I made a mistake: mMinX = mMaxX = -5
Herbert
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.