iOS Question Merging a canvas to imageview before saving to gallery

Mark Turney

Active Member
Licensed User
Longtime User
I'm drawing freehand (Less Note app) on a canvas which is initialized to a panel. After drawing, it's easy to save the drawing to the photo gallery using:
Dim svBmp As Bitmap
    svBmp = cvsDrawPad.CreateBitmap
    tm.ToastMessageShow("Current image saved to Photo Album", False)
However, there is an underlying imageview with various paper types (lined, graph, parchment). I would like to somehow merge the canvas onto the paper type before saving ... so it looks like I drew on the paper (which is just a png).

Any thoughts?

Thanks in advance!


Active Member
Licensed User
Longtime User
Yes, it's pretty easy. You do need to pass the background. This below isn't complete, but just add a second bitmap and assign it to an imageview and add it to photopanel. Add the background first, then the drawing on top.

Sub Watermark (Image As Bitmap, background as bitmap) As Bitmap
    Dim PhotoCanvas As Canvas
    Dim PhotoPanel As Panel
    Dim PhotoView As ImageView
    Dim NewImage As Bitmap
   Dim bView As Bitmap
    PhotoPanel.Width = Image.Width
    PhotoPanel.Height = Image.Height
    PhotoView.Bitmap = Image
    PhotoPanel.AddView(PhotoView, 0, 0, Image.Width ,Image.Height)
    NewImage = PhotoCanvas.CreateBitmap
    Return NewImage
End Sub
Upvote 0