Fraxx Daidouji
07-18-2005, 07:35 PM
Earsed
Figured it out.
Look at my last post.
Figured it out.
Look at my last post.
bitblt .NET style HelpFraxx Daidouji 07-18-2005, 07:35 PM Earsed Figured it out. Look at my last post. Iceplug 07-18-2005, 08:09 PM Why doesn't the bottom one look like the top one? You are only passing 0, 0 in as the first arguments of the rectangle? Also, for the top one, if it draws off by 1, have you examined the values of X and Y to see if they look OK. For example, if you click on the tile below the one at the upper left, you should get an X from 0 to 31 and a Y from 32 to 63. :) Fraxx Daidouji 07-18-2005, 09:01 PM Why doesn't the bottom one look like the top one? You are only passing 0, 0 in as the first arguments of the rectangle? Also, for the top one, if it draws off by 1, have you examined the values of X and Y to see if they look OK. For example, if you click on the tile below the one at the upper left, you should get an X from 0 to 31 and a Y from 32 to 63. :) Ok I check the values of the graphic used to show what tile is selected and yes it does jump from 0 to 32. Like this: Going to upload a graphic of it. I know what is happening. Its starting the graphic used to show what tile is selected at the top of the form and not the picturebox that holds the tiles. The top of the form happen to be where the toolbar is. Iceplug 07-19-2005, 08:52 AM Try doing something like to retranslate the points back onto the form. Dim P As Point = New Point(e.X, e.Y) 'Put the coordinates in to a point. Me.PointToClient(P) Now, use P.X and P.Y as your values for X and Y. :) Fraxx Daidouji 07-19-2005, 11:57 AM I put this right under Public Class Luna Private CurrentRect As New Rectangle Private Sub TileSet1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TileSet1.MouseMove Try Dim RectColor As New Pen(System.Drawing.Color.White) Dim Graphics1 As System.Drawing.Graphics Dim x1 As Integer Dim y1 As Integer 'calculate starting coordinates x1 = CInt(e.X \ 32) * 32 y1 = CInt(e.Y \ 32) * 32 'If it is already hightlight then exit. If CurrentRect.X = x1 And CurrentRect.Y = y1 Then Exit Sub Else Graphics1 = TileSet1.CreateGraphics With CurrentRect .X = x1 .Y = y1 .Height = CInt(32) .Width = CInt(32) End With End If 'clear existing TileSet1.Refresh() 'draw box around current tile Graphics1.DrawRectangle(RectColor, CurrentRect) 'Clean Up RectColor = Nothing Graphics1 = Nothing Catch End Try End Sub I stoped trying to do it the way I been doing it and tried it a whole different way and it worked. Now I don't have to use bitblt anymore to do what I wanted to do. |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum