![]() ![]() ' - Dim isDown, canResize, canMove As Boolean ' - ' original is a copy of the original image used as a source image. This is for moving the ' selection rectangle around the image. ' canMove is true when the left mouse button is pressed more than ' two pixels inside the selection rect. ' canResize is true when the mouse button is pressed over an edge ' of the selection rectangle. ![]() ' grab-handles for resizing selection Dim grabHandles( 8) As Rectangleĭim curs() As Cursor = įriend grabSize As New Size( 6, 6) ' size of grab-handle rects Friend grabPen As New Pen(Color.Black, 1) ' grab-handle outline Friend grabBrush As New SolidBrush(Color.White) ' grab-handle fill color Friend rectPoints As Point ' x-y location of sel rect Dim selSize As Size ' size of selection rect ' these are for drawing the selection rectangle Dim myPen As New Pen(Color.White, 1)ĭim innerBrush As New SolidBrush(Color.FromArgb( 60, 0, 0, 255))ĭim g As Graphics ' draw the original image ' - ' isDown is true anytime the left mouse button is pressed inside ' the source image. You'll ' see it used in the MouseMove sub. This ' is used to properly draw a new instance of sr. ' - ' sr is the selection rectangle ' r is used in drawing the source image ' RectInfo is a rectangle that holds the value of the ' last instance of the selection rectangle (sr). A look at the code.įriend title As String = " Background Tile Creator" Friend imgName As String ' the filename of the src image Dim msg As String ' for messages Dim x, y, l As Integer ' x&y coords, and width/height values Dim WithEvents pntPnl As New PaintPanel I'm still trying to figure out why this happens. Once an image is saved and used elsewhere, the lines do not appear. Known issue: When resizing the finished tile to make it larger, fine lines sometimes appear between the individual tiles in the Background Preview tab. A standard Windows SaveFileDialog will open. To save your tile, click the Save button in the tool bar. Given that the image is a tile, further flip/rotate actions have little meaningful effect. Checking the "Rotate 90 Deg CW" checkbox rotates the tile 90 degrees clockwise. You can resize the finished tile with the trackbar controls in the left pane. The tile will then be updated when you release the mouse instead If you notice the program slowing down during any part of the selection process, just uncheck the checkbox. Note that with selections larger than 100x100, this may adversely affect performance. ![]() To do this, check the "Update tile during selection" checkbox in the left pane. Both the tile and the page background preview can be updated as you draw or move the selection (this is mildly cool to watch). The source image by pressing the left mouse button inside it. You can also move the selection rectangle around You can resize the selection by pointing at the appropriate drag handle and dragging it in one direction or another. This second image is then flipped vertically and placed in the lower right corner,Īnd lastly the third image is again flipped horizontally and drawn to the lower left corner. The original selection is placed in the top left corner.īTC then flips the selection horizontally and places this image in the top right corner. When you drag a selection on a source image, BTC creates a new blank image twice the size of the selection. Just open an image, make a selection with the mouse, and the tile is created automatically. To bizarre depending upon your source image and the selection you make within it. Apologies to any of you who got a buggy copy of BTC.īackground Tile Creator ("BTC" from here on out) is a simple utility that creates background tile images from existing images. First: A recent update had a rather nasty bug that slipped past me. ![]()
0 Comments
Leave a Reply. |