TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
carterallon
NA
5
0
Error message
Feb 21 2004 12:53 PM
This is the error message given when i try and draw a rectangle An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: Invalid parameter used. I get an error from this code: Private Sub picBoard_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picImage.MouseMove If isDragging Then Dim gr As Graphics = picImage.CreateGraphics gr.Clear(picImage.BackColor) Dim rect As New Rectangle(startX, startY, e.X - startX, e.Y - startY) gr.DrawRectangle(Pens.Red, rect) gr.FillRectangle(Brushes.Transparent, rect) Dim bmpCropped As New Bitmap(e.X - startX, e.Y - startY) Dim grBitmap As Graphics = Graphics.FromImage(bmpCropped) grBitmap.DrawImage(picImage.Image, 0, 0, rect, _ GraphicsUnit.Pixel) picImage.Image = bmpCropped picImage.SizeMode = PictureBoxSizeMode.Normal gr.Dispose() End If End Sub This is supposed to crop the image from the rectangle drawn. the error is from this line of code because it accepts invalid inputs i think. Dim bmpCropped As New Bitmap(e.X - startX, e.Y - startY)
Reply
Answers (
0
)
Play Test C#-DirectX Game
Draw text on path