DrawImage1
Previous  Next

Draws part of an image on another image.
Syntax: DrawImage1 (image As Image, rectSrc As Rectangle, rectDest As Rectangle, transparent As Boolean)

image - The source image.
rectSrc - The part taken from the source image.
rectDest - The area on the target image which the image will be drawn to.
transparent - If true then the the color set with Drawer.SetTransparentColor1 will be transparent.
Example:
'Add a Drawer object named drawer, a Rectangle object named rectSrc ,a Rectangle object named  rectDest and a Bitmap object named bmpSrc.
Sub Globals

End Sub

Sub App_Start
      Form1.Show
      drawer.New1("Form1",false)
      brush1.New1(cRed)
      bmpSrc.New1(AppPath & "\smiley.gif") 'Loads an image from a file named smiley.gif
      rectSrc.New1(0,0,bmpSrc.Width,bmpSrc.Height) 'Same size as the image.
      rectDest.New1(100,100,25,25)
      drawer.SetTransparentColor1(bmpSrc.GetPixel1(0,0)) 'Sets the transparent color to be the color of pixel (0,0) in the bitmap
      drawer.DrawImage1(bmpSrc.Value,rectSrc.Value,rectDest.Value,true)
      drawer.Refresh2(rectDest.Value)     
End Sub