[Gambas-user] Paint an image

Fabien Bodard gambas.fr at ...626...
Sun Nov 24 13:55:40 CET 2013


> Public Sub fr_Draw()
>   Paint.Begin(fr)

>   fr.Background = Color.RGB(100, 140, 180)
>
>   Paint.Image(img, 0, 0)
>
>   paint.End
>
> End

cached must be false

and never set this property in the draw event ... but before... then
if you put the cached property to true, the draw event is not fired.



2013/11/24 Michael Kuyumcu <mkuyumcu at ...3233...>:
> Dear list members,
>
> in my program I seemingly cannot get an image to be painted.
>
> I have a DrawingArea called "fr".
> In memory I keep an image named "img".
>
>
> In my form code, I declare
>     public img as image
>
> In the Form_Open handler, I instantiate "img" with
>     img = New Image(fr.Width, fr.Height)
>
> In some other code that is then run, I fill the x/y pixels of "img" with
> integer values
>     img[x,y] = < some integer >
>
>
> Then I issue a "fr.Refresh" command, hoping "fr" would display
>
>
>> Public Sub fr_Draw()
>>   Paint.Begin(fr)
>>   fr.Cached = True
>>   fr.Background = Color.RGB(100, 140, 180)
>>
>>   Paint.Image(img, 0, 0) ???
>>
>>   paint.End
>>
>> End
>
>
> In the line containing the "???", I have tried many variations of code
> to make "img" appear in the "fr" DrawingArea, all without success.
> The background color, however, is displayed correctly.
>
> What do I have to write in place of "???" to make "img" display?
>
> Thank you.
>
> Regards,
> ukimiku
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard




More information about the User mailing list