[Gambas-devel] Transparent DrawingArea

RichardB deep_sky at ...761...
Mon Dec 19 22:24:50 CET 2016

Thanks for the advice - much appreciated.  But I'm still having problems.

I tried a simple test by creating a form with just a single button
(btnImage) and a DrawingArea (dwgImage) on it.  I added the following code
to the button's click function:

   Public Sub btnImage_Click()
    Dim hImage As Image 
    Dialog.Path = "/ home / gambas / projects / images" 
    Dialog.Filter = ["Image files (* .jpg; * .jpeg; * .png; * .bmp)", "All
files (*. *)"] 
    If Dialog.OpenFile() Then Return 
    hImage = New Image 
    dwgImage.Resize(hImage.Width, hImage.Height) 
    Draw.Fillcolor = Color.Gray 
    Draw.FillStyle = Fill.Solid 
    Draw.Rect(0, 0, hImage.Width, hImage.Height) 
    Draw.Image(hImage, 0, 0) 
    dwgImage.Visible = True 
    Message.Warning(Error.Text & "!")

When run, the dialog opens fine, I select the image ok...but it fails on the
"Draw.Begin(dwgImage) " line, with the error "Cannot paint outside of draw
event handler".  I can't see where I've made an error.

Thanks again for your help.

View this message in context: http://gambas.8142.n7.nabble.com/Transparent-DrawingArea-tp58023p58033.html
Sent from the gambas-devel mailing list archive at Nabble.com.

More information about the Devel mailing list