9/4/2023 0 Comments Directx end runtimeUsing font As Font = New Font("Arial", 16,, GraphicsUnit.Point)ĭim rect As Rectangle = New Rectangle(0, nHeight, nWidth, nTextHeight) G.DrawImage(img, New Rectangle(New Point(), img.Size), New Rectangle(New Point(), img.Size), GraphicsUnit.Pixel) Using g As Graphics = Graphics.FromImage(bmp) You can do something like this : Dim img As Drawing.Image = ("E:\Butterfly_small.png")ĭim bmp As Bitmap = New Bitmap(nWidth, nHeight + nTextHeight, 32bppArgb) Me.WindowState = FormWindowState.Minimized Gr.DrawImage(bm, 0, 0, New Rectangle(dx, dy, wid, hgt), GraphicsUnit.Pixel) ' Copy the part of the original bitmap that we wantĭim gr As Graphics = Graphics.FromImage(bm2) ' Get the offset from the window's corner to its client Me.DrawToBitmap(bm, New Rectangle(0, 0, wid, hgt)) If Me.WindowState = FormWindowState.Minimized Then Private Function GetFormImage(ByVal include_borders As Boolean) As Bitmap Sfd.Dispose() 'Dispose the SaveFileDialog when no longer needed Grp.DrawImage(OriginalImage, New Rectangle(0, 0, CropRect.Width, CropRect.Height), CropRect, GraphicsUnit.Pixel) Using grp = Graphics.FromImage(CropImage) Img.Save(sfd.FileName, .Jpeg)ĭim CropRect As New Rectangle(25, 105, 145, 160)ĭim OriginalImage = Image.FromFile(fileName)ĭim CropImage = New Bitmap(CropRect.Width, CropRect.Height) If sfd.ShowDialog = DialogResult.OK Then 'If the user presses "Ok" button on the SaveFileDialog Sfd.AddExtension = True 'Make sure the extension is added to the FileName Sfd.Filter = "Jpg Image|*.jpg|Bmp Image|*.bmp|Png Image|*.png" Private Sub btnSaveQRCode_Click(sender As Object, e As EventArgs) Handles btnSaveQRCode.Click So I have this code that saves an image (QR Code Image) and I would like to save text overlay for example add text "QR Code".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |