[Gambas-user] gb.util: Unit conversions

Fabien Bodard gambas.fr at ...626...
Sun Apr 26 22:57:38 CEST 2015


This is an example with an usefull class from gb.report... i have
modified it to be more generic.

the pixel convertion use the desktop.resolution value.

2015-04-26 9:34 GMT+02:00 Charlie Reinl <Karl.Reinl at ...9...>:
> Am Samstag, den 25.04.2015, 23:13 +0200 schrieb Tobias Boege:
>> On Sat, 25 Apr 2015, Beno?t Minisini wrote:
>> > Le 20/04/2015 23:28, Tobias Boege a ?crit :
>> > > Hi Benoit,
>> > >
>> > > I have a quick feature suggestion for gb.util: when working with components
>> > > like gb.cairo which partially uses millimeters (e.g. CairoPdfSurface._new)
>> > > to measure things, it would be nice to have a global module from somewhere
>> > > official which implements those unit conversions.
>> > >
>> > > I am myself always uncertain with "graphical" units and if they could under
>> > > any circumstances depend on resolutions or not. A bunch of working methods
>> > > would be nice and gb.util is the right place for that it seems.
>> > >
>> > > Regards,
>> > > Tobi
>> > >
>> >
>> > I don't see what conversion you need exactly. Can you be more precise?
>> >
>>
>> Things like px <-> mm <-> in. I'm sure there are a lot more unit conversions
>> that people may find useful. Although I'm not sure anymore if it's a good
>> idea to put those into a component, because it's basically multiplying by
>> some constant... The thing is simply that these constants are not easy to
>> memorise and sometimes they depend on some resolution or other factors of
>> which people like me aren't aware. A conversion function in a component,
>> once written by a clever person would come to the rescue then.
>>
>> Regards,
>> Tobi
>>
>
> Salut,
>
> what's about a conversions page on gambaswiki.org?
> That would be one page about measure conversion more in the net, but
> easy to find for gambas coder.
>
> --
> Amicalement
> Charlie
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SizeUnitConverterDemo-0.0.1.tar.gz
Type: application/x-gzip
Size: 6859 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150426/0fd29f76/attachment.bin>


More information about the User mailing list