

ReDim Preserve corners(2) ' Draw the result onto the output Bitmap. Dim bm_out As New (CInt(-2 * xmin), CInt(-2 * _ ymin)) Dim gr_out As = (bm_out) ' Drop the last corner lest we confuse DrawImage, ' which expects an array of three corners. Dim xmin As Single = corners(0).X Dim ymin As Single = corners(0).Y For i = 1 To 3 If xmin > corners(i).X Then xmin = corners(i).X If ymin > corners(i).Y Then ymin = corners(i).Y Next i For i = 0 To 3 corners(i).X -= xmin corners(i).Y -= ymin Next i ' Create an output Bitmap and Graphics object. Dim theta As Single = Single.Parse(RotationAngle) * _ / 180.0 Dim sin_theta As Single = (theta) Dim cos_theta As Single = (theta) Dim X As Single Dim Y As Single For i = 0 To 3 X = corners(i).X Y = corners(i).Y corners(i).X = X * cos_theta + Y * sin_theta corners(i).Y = -X * sin_theta + Y * cos_theta Next i ' Translate so X >= 0 and Y >=0 for all corners. Dim cx As Single = wid / 2 Dim cy As Single = hgt / 2 Dim i As Long For i = 0 To 3 corners(i).X -= cx corners(i).Y -= cy Next i ' Rotate.

MyGraphics = (bmpImage) MyGraphics.Clear() MyGraphics.TextRenderingHint = MyGraphics.DrawString(sImageText, MyFont, New Drawing.SolidBrush(), 0, 0) MyGraphics.Flush() Return bmpImage End Function Function RotateImage(ByVal bm_in As, ByVal RotationAngle As Integer) As Dim wid As Single = bm_in.Width Dim hgt As Single = bm_in.Height Dim corners As () = ' Translate to center the bounding box at the origin. bmpImage = New Drawing.Bitmap(bmpImage, New Drawing.Size(iWidth, iHeight)) '// Add the colors to the new bitmap. iWidth = MyGraphics.MeasureString(sImageText, MyFont).Width iHeight = MyGraphics.MeasureString(sImageText, MyFont).Height '// Create the bmpImage again with the correct size for the text and font. Dim MyGraphics As Drawing.Graphics = (bmpImage) 'This is where the bitmap size is determined. Dim MyFont As New Drawing.Font(FontType, FontSize,, ) 'Create a graphics object to measure the text's width and height.
#Lego digital designer rotate 45 degrees code
Open “Report Properties”, click “Code” tab, copy the following code into the code surface: Function CreateImage(ByVal sImageText As String, ByVal FontType As String, ByVal FontSize As Integer) As 'Create an image from scratch Dim bmpImage As New Drawing.Bitmap(1, 1) Dim iWidth As Integer = 0 Dim iHeight As Integer = 0 'Create the Font object for the image text drawing.The detailed steps for you, please refer to the steps below: Actually, the code includes four functions, and we need to eliminate two non-code sentences under the “for step3 use following function:” node. Based on my test, the code in the article
