locked
Scale and rotate image and place in picturebox control with new size RRS feed

  • Question

  • Hi, I'm trying to work on getting an image to scale and rotate and then place it back in a picturebox control, but I need to resize the picturebox to the new image and running into a little trouble there.  After doing a bunch of searching around, I've ended up with the below code, but the image that's being returned is of the same exact dimensions as the original, causing cropping (when rotating or scaling the image bigger) or excessive blank spacing around the image (scaling the image smaller). This is my first time dealing with image manipulation of this nature, so I'm assuming I'm failing to understand a concept somewhere, so if someone could help me figure it out that would be great.

    I obtained the code I'm using from here (https://stackoverflow.com/questions/40431154/rotating-an-image-in-a-picture-box) and adapted to include the scaling when I found the ScaleTransform method.

    Should note this is in VB.Net, using Visual Studio 2012.

    Private Function ScaleAndRotateImage(img As Image, scalefactor As Double, angle As Integer) As Bitmap
    	Dim retBMP As New Bitmap(img.Width, img.Height)
    	retBMP.SetResolution(img.HorizontalResolution, img.VerticalResolution)
    	Using g = Graphics.FromImage(retBMP)
    		g.TranslateTransform(img.Width \ 2, img.Height \ 2)
    		g.ScaleTransform(scalefactor, scalefactor)
    		g.RotateTransform(angle)
    		g.TranslateTransform(-img.Width \ 2, -img.Height \ 2)
    		g.DrawImage(img, New PointF(0, 0))
    	End Using
    	Return retBMP
    End Function


    Thank you!

    EDIT:

    So still working on this and just tried out the below code changes.  This appears to help scaling, though I don't know if there's a better way?  Now need to "fix" rotation so it doesn't crop the corners.

    Private Function ScaleAndRotateImage(img As Image, scalefactor As Double, angle As Integer) As Bitmap
    	Dim retBMP As New Bitmap(CInt(img.Width * scalefactor), CInt(img.Height * scalefactor))
    	retBMP.SetResolution(img.HorizontalResolution * scalefactor, img.VerticalResolution * scalefactor)
    	Using g = Graphics.FromImage(retBMP)
    		g.TranslateTransform(retBMP.Width \ 2, retBMP.Height \ 2)
    		'g.ScaleTransform(scalefactor, scalefactor)
    		g.RotateTransform(angle)
    		g.TranslateTransform(-retBMP.Width \ 2, -retBMP.Height \ 2)
    		g.DrawImage(img, New PointF(0, 0))
    	End Using
    	Return retBMP
    End Function

    • Edited by FotS Wednesday, June 13, 2018 4:46 PM Updated my attempts
    Wednesday, June 13, 2018 4:27 PM

All replies

  • Please show images of exactly what you mean. For example, this is what I get from this code. This is what I want to get.

    Here is an example you might like.

    PS if you rotate a square peg in a square hole then the corners will hit (get cropped). So you must decrease the image  size or increase picbox size or something.

    First you have to calc how much reduction. Show an image of how you want to rotate and size picture to fit into the picturebox.

    For example run your first example above and call with scalefactor = 1 (no size change) scalefactor = 0.5 (image size reduced by half) and again with = 2 (image size doubled). See the result? If not show us what you get.





    Wednesday, June 13, 2018 4:59 PM
  • Upper left box was using the old code and had the undesirable extra space around the ScaleTransform image.  Width and Height values for the new image were identical to the original image that was fed in, so the PictureBox remained at that size, overlapping the image below.

    Lower left box used the edited code I posted up.  This is ideal condition for scaling effect.

    Box on the right is rotated 45°.  Note corners are cropped.  I need to find a way to resize it so this doesn't happen, but without shrinking the image itself.  I'm assuming I'm going to have to do some manual calculations somewhere to determine the new bounding box size?  User is capable of rotating the image at 15° increments.

    The resulting images do need to wind up in a PictureBox control as I've added code that makes the controls draggable by the user.  Unless someone knows a better way.

    EDIT: Actually, here.  If I use one of my backgrounds that's white, it might help illustrate it better.

    EDIT2: Course, I forgot the forum pages are white, too.  Just simply used paint.net to fill the middle area in blue to better highlight the PictureBoxes themselves.

    • Edited by FotS Wednesday, June 13, 2018 5:32 PM
    Wednesday, June 13, 2018 5:17 PM
  • Fots,

    Here is a better example. See how the black rect is not modified, the blue rect is rotated, the red rect is rotated and scaled by 0.5 (half).

    Public Class Form5
        Private Sub Form5_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim w2 As Integer = CInt(Me.ClientSize.Width / 2)
    
            With e.Graphics
                'move origin to center
                .TranslateTransform(w2, w2)
    
                'draw a 280 pixel rect  with no rotation
                Dim w As Integer = 280
                .DrawRectangle(Pens.Black, CInt(-w / 2), CInt(-w / 2), w, w)
    
                'rotate by 45
                .RotateTransform(45)
                'draw same rect rotated
                .DrawRectangle(Pens.Blue, CInt(-w / 2), CInt(-w / 2), w, w)
    
                'scale by half
                .ScaleTransform(0.5, 0.5)
                'draw same rect rotated and scaled by half
                .DrawRectangle(Pens.Red, CInt(-w / 2), CInt(-w / 2), w, w)
    
    
    
            End With
    
    
        End Sub
    
        Private Sub Form5_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'make form client area 300 pixels wide
            ClientSize = New Size(300, 300)
            BackColor = Color.White
    
    
    
        End Sub
    End Class


    PS I have used the form like a picturebox.

    Wednesday, June 13, 2018 5:38 PM
  • So just to clarify real fast, I'm not simply drawing rectangles.  I'm loading pre-made images into PictureBoxes that the user can add, remove, rotate, and drag around on the main section of the form at will.  These images can be (technically) anything, though typical usage is expected to be outline shapes of real-world objects.  Scaling is an automatic feature that depends on scale settings of these images and scale settings of a layout image (what the user is dragging the other images over) so that they all stay "to scale".

    I merely created a quick image of a box that was for testing purposes.


    EDIT: Just found this other post which claims to do the job I'm looking for on the rotating.  Looks like they just manually calculated out the new size of the image before rotating, so guess that's the route I'm going....

    https://stackoverflow.com/questions/2352804/how-do-i-prevent-clipping-when-rotating-an-image-in-c


    • Edited by FotS Wednesday, June 13, 2018 5:58 PM
    Wednesday, June 13, 2018 5:49 PM
  • So just to clarify real fast, I'm not simply drawing rectangles.  I'm loading pre-made images into PictureBoxes that the user can add, remove, rotate, and drag around on the main section of the form at will.  These images can be (technically) anything, though typical usage is expected to be outline shapes of real-world objects.  Scaling is an automatic feature that varies depending on scale settings of these images and scale settings of a layout image (what the user is dragging the other images over) so that they all stay "to scale".

    I merely created a quick image of a box that was for testing purposes.

    Yes. I see now.

    Where I have DrawRectangle you need DrawImage and dont use a picturebox.

    Just have one background picturebox for the whole thing and then draw everything you want on the one background object (picbox, form, etc).

    Dont use many pictureboxes all with their own image. Just draw the image on the background graphics.

    Do all the drawing on one picturebox or graphics surface.

    Instead of picturebox rects you have drawRectangle or drawImage.

    I don't know how you are moving the picboxes now by user but all that will now be move the image that you draw ie translate, rotate, scale.

    Comprende?

    Wednesday, June 13, 2018 5:58 PM
  • So, I'm using the code I found here for moving the PictureBoxes.

    https://stackoverflow.com/questions/5570275/allow-end-user-to-move-a-control

    As each image needs to be able to move individually from the rest for the user to place where ever they want, then rearrange again if they desire, I'm not sure how your solution will help on that?

    Wednesday, June 13, 2018 6:00 PM
  • PS By drawing everything on the one picbox (graphic surface) you don't get the rotated image corners cropped because the background is large enough to show the corners. There are no pictureboxes to deal with. That is where the problem is. You will have to change. You cant rotate a picturebox control in vb.

    Once you see what I mean it will be much easier. But you will have to redo your gui for the user to drag and rotate and size.

    Wednesday, June 13, 2018 6:03 PM
  • I certainly understand what you mean, but how do I allow the user to move an image around that's drawn like that, then?  I want this to be as simple as like dragging icons around on your desktop.  I also currently have it setup so that for rotating, they right-click on the image they want rotated, get a ContextMenu, then select the rotation (-/+15° or -/+45° increment) they want.  In this same ContextMenu is a remove option.  I then have two other remove options in other areas where they can clear out everything, or only the images of one type.

    Example on the removing, they can load multiple images into the right hand pane (ex: box.png, circle.png, squiggle.png).  They click the buttons to add 5 boxes, 2 circles, and 10 squiggles to the main center of the form and drag them around.  To remove some of it, they can a) right-click an individual squiggle and choose remove, b) click the button for removing circle.png from the list, which will in turn remove all circles from the main form, or c) click a "clear all" button up top to remove it all back to the base layout image.

    Wednesday, June 13, 2018 6:14 PM
  • So, I'm using the code I found here for moving the PictureBoxes.

    https://stackoverflow.com/questions/5570275/allow-end-user-to-move-a-control

    As each image needs to be able to move individually from the rest for the user to place where ever they want, then rearrange again if they desire, I'm not sure how your solution will help on that?

    You will have to redo that part.

    You should not be doing it as that example if you want to rotate the image and drag it and resize etc.

    Trust me. :)

    You are not drawing a web page you are drawing a CAD drawing. So you will have to tighten all that up.

    Otherwise when you try to rotate an image it will crop inside the pic box. Trying to make the pic box larger to accomidate the rotation is not the way to go. Was there rotation in the example you followed?

    Do you want me to post an example?

    Wednesday, June 13, 2018 6:16 PM
  • I certainly understand what you mean, but how do I allow the user to move an image around that's drawn like that, then?  I want this to be as simple as like dragging icons around on your desktop.  I also currently have it setup so that for rotating, they right-click on the image they want rotated, get a ContextMenu, then select the rotation (-/+15° or -/+45° increment) they want.  In this same ContextMenu is a remove option.  I then have two other remove options in other areas where they can clear out everything, or only the images of one type.

    Example on the removing, they can load multiple images into the right hand pane (ex: box.png, circle.png, squiggle.png).  They click the buttons to add 5 boxes, 2 circles, and 10 squiggles to the main center of the form and drag them around.  To remove some of it, they can a) right-click an individual squiggle and choose remove, b) click the button for removing circle.png from the list, which will in turn remove all circles from the main form, or c) click a "clear all" button up top to remove it all back to the base layout image.

    I will post an example in a few hours or so.

    Its what I do as the Donald would say.

    :)

    Wednesday, June 13, 2018 6:17 PM
  • PS In the mean time look this over here.

    If that is not what you want just say so and we can try something else.

    Wednesday, June 13, 2018 6:22 PM
  • I certainly understand what you mean, but how do I allow the user to move an image around that's drawn like that, then? 

    By maintaining your own collection of objects to be drawn.  The mouse event handlers can then look through the collection of drawing objects and find the one under the pointer and change its properties (location/size) as appropriate to produce dragging and resizing operations, or show menus whose options then act on the "selected" drawing object.

    You'll likely have two main classes, a DrawingCanvas and a DrawingObject.  The DrawingCanvas contains a collection of DrawingObjects that it renders in its Paint event handler and manipulates in its mouse/keyboard event handlers.  The DrawingObject contains information about position, size, rotation, what to draw, etc.

    You have to decide what functionality you are going to support (Can the user zoom or scroll the canvas? Will you want to save or print the drawing? Will you need compound objects made up of simpler objects? etc.) and then design your DrawingObject and DrawingCanvas to suit these needs.  This determines the required complexity and amount of code that you'll need and can range from quite simple/small amount of code to quite complex/large amounts of code, depending on what you want to support.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Wednesday, June 13, 2018 6:29 PM
  • I certainly understand what you mean, but how do I allow the user to move an image around that's drawn like that, then? 

    By maintaining your own collection of objects to be drawn.  The mouse event handlers can then look through the collection of drawing objects and find the one under the pointer and change its properties (location/size) as appropriate to produce dragging and resizing operations, or show menus whose options then act on the "selected" drawing object.

    You'll likely have two main classes, a DrawingCanvas and a DrawingObject.  The DrawingCanvas contains a collection of DrawingObjects that it renders in its Paint event handler and manipulates in its mouse/keyboard event handlers.  The DrawingObject contains information about position, size, rotation, what to draw, etc.

    You have to decide what functionality you are going to support (Can the user zoom or scroll the canvas? Will you want to save or print the drawing? Will you need compound objects made up of simpler objects? etc.) and then design your DrawingObject and DrawingCanvas to suit these needs.  This determines the required complexity and amount of code that you'll need and can range from quite simple/small amount of code to quite complex/large amounts of code, depending on what you want to support.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Ok, this might be part of my problem.  I didn't realize that drawings made in this fashion could be stored in an object that could then... how to put this... easily detect when the mouse was on it.  Time was something of a factor as if it takes too long to make, then the point/affect is wasted.  Manual zooming and panning/scrolling are not needed, though.

    Re: Tommytwotrain,

    Thanks, and sorry for my ignorance on this. :/

    Essentially, yes, it is like a CAD drawing program.  The difference is that it was depending on pre-made images and shapes that you then loaded into it and threw out into the main area.  Your link to your code may help some as it'd allow me to figure out moving the shapes around.

    I guess to lay out fully, exactly what I'm doing....

    My girlfriend is looking at getting new furniture for the house.  One of the key things she's looking at is a sectional.  After looking at a couple, we realized we needed measurements of the rooms.  I took these and created a very basic png image to print out so she could see the room sizes and dimensions.  She then commented about how it was too bad we couldn't "try" the furniture out in our house in some way to see how it would all fit.  My best answer to this is what I'm creating.

    The plan is that she can load a pre-made png image as the primary background (the room) and then several other, smaller, pre-made png files into a list on the side (the furniture).  I'm going to create these pngs so she doesn't have to (and she'd quickly get discouraged if she did).  Then, she can just click buttons to add the number and types of furniture she wants, then drag it around to try different layouts.

    I didn't want to spend a huge amount of time on it.  I only started this... Sunday?  Maybe Saturday, and this rotation thing is the last thing that's tripping me up.  After this, there's a couple GUI improvements I've thought of, and then it's creating the pngs based on the furniture measurements.

    I didn't want to get too complex on it as the time needed would defeat the purpose and if she had to create each and every little object herself she'd quickly get bored and discouraged with it.

    Wednesday, June 13, 2018 6:40 PM
  •  

    I didn't want to get too complex on it as the time needed would defeat the purpose and if she had to create each and every little object herself she'd quickly get bored and discouraged with it.

    I see. Well maybe its too much. Did you try google Sketch Up?

    I think maybe it will be a lot of work.

    So here is an example that (is more like you originally wanted). Maybe you can get this to work for you.

    Note it is just a start not perfect. You need to get it working then you need to set the initial rotation so it does not jump when you first start rotating.

    However, sometimes it takes just as long to do it the wrong way as to start over with the better way.

    I only did this cause Razerz said it could not be done.

    PS The example creates two pic boxes all you need to do is paste the code in an empty form. Also add paths to your own two images. Image in the PicR will rotate.

    'rotating picturebox example using a region
    '(c) 2017 Sandia Software v1
    Option Strict On
    Imports System.Drawing.Drawing2D
    
    Public Class PictureBoxRotate
        Private WithEvents picR As New PictureBox With {.Parent = Me, .Cursor = Cursors.Hand,
            .BackgroundImageLayout = ImageLayout.Stretch,
            .BackgroundImage = Image.FromFile("c:\bitmaps\apple100.png"),
            .Location = New Point(100, 100), .Size = New Size(100, 100), .BackColor = Color.SteelBlue}
        Private WithEvents picBG As New PictureBox With {.Parent = Me,
            .BackgroundImageLayout = ImageLayout.Stretch,
            .BackgroundImage = Image.FromFile("c:\bitmaps\clouds.jpg"),
            .Location = New Point(10, 50), .Size = New Size(200, 100)}
        Private picRSize As New Size(100, 100)
        Private picRCenter As New Point(150, 150)
        Private angle As Double = 0
    
        Private Sub Form7_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Text = "Rotate Picturebox"
            BackColor = Color.Teal
            ClientSize = New Size(300, 300)
            DoubleBuffered = True
    
            SetRotated(picR, CSng(angle))
    
        End Sub
    
        Private Function GetAngle(ByVal ptFrom As PointF, ByVal ptTo As PointF) As Double
            Dim dx As Double = ptFrom.X - ptTo.X
            Dim dy As Double = ptFrom.Y - ptTo.Y
            Dim a As Double = 57.3 * Math.Atan2(dy, dx)
            If a > 360 Then a -= 360
            If a < 0 Then a += 360
    
            Return a
        End Function
    
        Private Sub picR_MouseMove(sender As Object, e As MouseEventArgs) Handles picR.MouseMove
    
            If e.Button = MouseButtons.Left Then
                'MouseMovePt = e.Location
                angle = GetAngle(e.Location, New Point(CInt(picR.Bounds.Width / 2),
                                           CInt(picR.Bounds.Height / 2)))
    
                SetRotated(picR, CSng(angle))
    
                Refresh()
            End If
        End Sub
    
        Private Sub picR_Paint(sender As Object, e As PaintEventArgs) Handles picR.Paint
            'draw the rotated image
            Using mx As New Matrix
                mx.RotateAt(CSng(angle), New PointF(CSng(picR.ClientSize.Width / 2), CSng(picR.ClientSize.Height / 2)))
                e.Graphics.Transform = mx
                Dim x As Integer = CInt((picR.ClientSize.Width / 2) - (picR.BackgroundImage.Width / 2))
                Dim y As Integer = CInt((picR.ClientSize.Height / 2) - (picR.BackgroundImage.Height / 2))
                e.Graphics.DrawImage(picR.BackgroundImage, x, y,
                                     picR.BackgroundImage.Width, picR.BackgroundImage.Height)
            End Using
        End Sub
    
        Private Sub SetRotated(thePic As PictureBox, angle As Single)
    
            Using rg As New Region,
                    mx As New Matrix,
                    pth As New GraphicsPath
    
                'get the size of the rotated rect
                pth.AddRectangle(New RectangleF(0, 0, picRSize.Width, picRSize.Height))
                mx.RotateAt(angle, New PointF(CSng(picRSize.Width / 2), CSng(picRSize.Height / 2)))
                pth.Transform(mx)
                Dim rect As RectangleF = pth.GetBounds()
    
                'size the pict to fit the rect
                thePic.ClientSize = New Size(CInt(rect.Width + 1), CInt(rect.Height + 1))
                'Dim x1 As Integer = CInt((thePic.Width / 2))
                'Dim y1 As Integer = CInt((thePic.Height / 2) - (picRSize.Height / 2))
                'thePic.Location = New Point(CInt(x1 - thePic.ClientSize.Width / 2), CInt(y1 - thePic.ClientSize.Height / 2))
                thePic.Location = New Point(CInt(picRCenter.X - thePic.ClientSize.Width / 2), CInt(picRCenter.Y - thePic.ClientSize.Height / 2))
    
    
                'remake the path rect at the new pic center and rotate
                pth.Reset()
                Dim x1 As Integer = CInt((thePic.ClientSize.Width / 2) - (picRSize.Width / 2))
                Dim y1 As Integer = CInt((thePic.ClientSize.Height / 2) - (picRSize.Height / 2))
                pth.AddRectangle(New RectangleF(x1, y1, picRSize.Width, picRSize.Height))
                mx.Reset()
                mx.RotateAt(angle, New PointF(CSng(thePic.ClientSize.Width / 2), CSng(thePic.ClientSize.Height / 2)))
                pth.Transform(mx)
    
                'add rotated path region to picturebox
                thePic.Region = New Region(pth)
    
            End Using
        End Sub
    
    End Class

    PS So you have two methods to think about:

    1. What you were doing drawing with many Pictureboxes using the rotate picturebox example.

    2. True CAD drawing using the CAD example.

    I think most of what you need to do is basically the same either way overall the more I think about it?

    Its just you have to start over the CAD way?

    But I already did it for you if you look at the example.

    You just need to add the object data base (copy what you have probably?) and the rotating.

    Note the CAD example you can now drag a rectangle and find it and it has a handle you can drag and resize it. You just need to add a handle to rotate it.


    :)







    Wednesday, June 13, 2018 7:20 PM
  • Thanks, I appreciate all of your help one this.  Unfortunately, I wasn't successful in adapting your code to work with the method for rotating I already had in place (right-click and choose an angle and direction).  It would rotate, but it would only leave the corners (so it looked like 4 triangles).  I forgot to grab a screen shot of it to be able to show.

    I was, however, successful in translating the C# method I found and linked up earlier to VB and that has worked great.  It doesn't rotate perfectly on center of the image, but it's close enough for now.  All I had to do was stick in 3 lines of code to scale the image first before feeding it through the rotation (although technically I guess I could've done that after, too).

    Here's the new code:

    Private Function ScaleAndRotateImage(img As Image, scalefactor As Double, angle As Integer) As Bitmap
    	'Scale image
    	Dim scaledimage As New Bitmap(CInt(img.Width * scalefactor), CInt(img.Height * scalefactor))
    	Dim gr As Graphics = Graphics.FromImage(scaledimage)
    	gr.DrawImage(img, 0, 0, scaledimage.Width + 1, scaledimage.Height + 1)
    	'Rotate image
    	Dim mRotate As Drawing2D.Matrix = New Drawing2D.Matrix()
    	mRotate.Translate(scaledimage.Width / -2, scaledimage.Height / -2, Drawing2D.MatrixOrder.Append)
    	mRotate.RotateAt(angle, New System.Drawing.Point(0, 0), Drawing2D.MatrixOrder.Append)
    	Using gp As Drawing2D.GraphicsPath = New Drawing2D.GraphicsPath()
    		' transform image points by rotation matrix
    		gp.AddPolygon(New System.Drawing.Point() {New System.Drawing.Point(0, 0), New System.Drawing.Point(scaledimage.Width, 0), New System.Drawing.Point(0, scaledimage.Height)})
    		gp.Transform(mRotate)
    		Dim pts As System.Drawing.PointF() = gp.PathPoints
    		' create destination bitmap sized to contain rotated source image
    		Dim bbox As Rectangle = boundingBox(scaledimage, mRotate)
    		Dim bmpDest As Bitmap = New Bitmap(bbox.Width, bbox.Height)
    		Using gDest As Graphics = Graphics.FromImage(bmpDest)
    			' draw source into dest
    			Dim mDest As Drawing2D.Matrix = New Drawing2D.Matrix()
    			mDest.Translate(bmpDest.Width / 2, bmpDest.Height / 2, Drawing2D.MatrixOrder.Append)
    			gDest.Transform = mDest
    			gDest.DrawImage(scaledimage, pts)
    			Return bmpDest
    		End Using
    	End Using
    End Function
    
    Private Function boundingBox(img As Image, matrix As Drawing2D.Matrix) As Rectangle
    	Dim gu As GraphicsUnit = New GraphicsUnit()
    	Dim rImg As Rectangle = Rectangle.Round(img.GetBounds(gu))
    
    	' Transform the four points of the image, to get the resized bounding box.
    	Dim topLeft As System.Drawing.Point = New System.Drawing.Point(rImg.Left, rImg.Top)
    	Dim topRight As System.Drawing.Point = New System.Drawing.Point(rImg.Right, rImg.Top)
    	Dim bottomRight As System.Drawing.Point = New System.Drawing.Point(rImg.Right, rImg.Bottom)
    	Dim bottomLeft As System.Drawing.Point = New System.Drawing.Point(rImg.Left, rImg.Bottom)
    	Dim points As System.Drawing.Point() = New System.Drawing.Point() {topLeft, topRight, bottomRight, bottomLeft}
    	Dim gp As Drawing2D.GraphicsPath = New Drawing2D.GraphicsPath(points, New Byte() {Drawing2D.PathPointType.Start, Drawing2D.PathPointType.Line, Drawing2D.PathPointType.Line, Drawing2D.PathPointType.Line})
    	gp.Transform(matrix)
    	Return Rectangle.Round(gp.GetBounds())
    End Function

    For now, for the purposes of getting it working so my girlfriend can toy around with furniture design ideas, this is how I'll leave it.  If I find myself with time and the motivation later, though, I'll probably do further reading on the graphics drawing methods / CAD example you posted.  It really was an issue of I simply didn't realize that the drawn images could be captured in an object that then could have location information and mouse related events, otherwise I may very well have started down that path instead.

    Again, thank you for the help!

    Thursday, June 14, 2018 3:19 PM
  • Hi FotS,

    It seems that you have solved your issue by yourself, please remember to close your thread by marking your last post or helpful post as answer, it is beneficial to other community members who face the same issue.

    Thanks for your understanding.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 19, 2018 7:01 AM
  • Hi FotS,

    It seems that you have solved your issue by yourself, please remember to close your thread by marking your last post or helpful post as answer, it is beneficial to other community members who face the same issue.

    Thanks for your understanding.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Actually I answered the question my first post but no one listened.

    Tuesday, June 19, 2018 11:32 AM