[Gambas-user] Two problems painting richtext

Fabien Bodard gambas.fr at ...626...
Tue Jul 16 21:40:59 CEST 2013


Public Sub dwgDrawRichText_Draw()

  Dim hExtent As PaintExtents



  Paint.Text("Align.Center OK.", 0, 0, Paint.Width, Paint.Height,
Align.Center)
  hExtent = Paint.PathExtents
  Paint.Brush = Paint.RadialGradient(hExtent.X, hExtent.Y,
Max(hExtent.Width, hExtent.Height), hExtent.X + hExtent.Width / 2,
hExtent.y + hExtent.Height / 2, [Color.Black, Color.Transparent], [0.0,
1.0])

  Paint.Fill
  Paint.Rectangle(hExtent.X - 5, hExtent.Y - 5, hExtent.Width + 10,
hExtent.Height + 10)
  Paint.Stroke()

End


2013/7/14 Tobias Boege <taboege at ...626...>

> Hi,
>
> I want to paint richtext which is:
>
> a) fading in a RadialGradient (black towards transparency) and
> b) centered in a rectangle.
>
> I can achieve a) when using Paint.RichText() followed by Paint.Fill(). But
> with this code, the text is not centered (although I specified Align.Center
> as a parameter to Paint.RichText()). This is a) without b).
>
> If I use Paint.DrawRichText(), the text is centered in the rectangle but
> the
> RadialGradient brush does not take effect. This is b) without a).
>
> I hope this is a bug and I can do both at a time. :-) Project and
> screenshot
> of the non-working result here are attached.
>
> Regards,
> Tobi
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&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