[Gambas-user] drawing rectangles on a picture.

Gianluigi bagonergi at gmail.com
Sun Oct 18 14:52:03 CEST 2020


Il giorno dom 18 ott 2020 alle ore 14:22 Gianluigi <bagonergi at gmail.com> ha
scritto:

>
>
> Il giorno dom 18 ott 2020 alle ore 13:57 KKing <kicking177 at gmail.com> ha
> scritto:
>
>> So I want to load a png, then draw some rectangles on it and resave it.
>>
>> Any pointers, after reading and searching I'm just confused by Draw,
>> Paint, DrawingArea, PictureBox etc.
>>
>> Also why does
>>      PictureBox1.Picture = Picture.Load("/media/user01/Test01.png")
>> work but
>>    myPicture = New Picture
>>    myPicture.Load("/media/user01/Test01.png")
>>    PictureBox1.Picture = myPicture
>> does not ?
>>
>
> Public Sub Form_Open()
>
>   Dim hImg1 As Image
>   Dim hImage As ImageView
>
>   hImage = New ImageView(Me)
>   hImage.W = 272
>   hImage.H = 272
>   hImg1 = Picture["icon:/256/linux"].Image
>   With paint
>     .Begin(hImg1)
>     .DrawRect(20, 20, 50, 50, Color.Blue, 2)
>     .End
>   End With
>   hImage.Image = hImg1
>
> End
>
> Regards
> Gianluigi
>

I forgot, to save:
hImg1.Save(User.Home &/ "MyTestImage.png", 0)

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201018/9e958b21/attachment.htm>


More information about the User mailing list