[Gambas-user] Picture.ToString() ?

Bruce Steers bsteers4 at gmail.com
Wed Jan 3 23:44:14 CET 2024


On Mon, 1 Jan 2024 at 22:56, Bruce Steers <bsteers4 at gmail.com> wrote:

>
>
> On Mon, 1 Jan 2024 at 19:52, Benoît Minisini <
> benoit.minisini at gambas-basic.org> wrote:
>
>> Le 01/01/2024 à 18:48, Benoît Minisini a écrit :
>> >
>> > I'm currently adding the 'ToString()' methods for both toolkits and
>> both
>> > Picture and Image classes. But it's not finished.
>> >
>> > Regards,
>> >
>>
>> The methods have been added in the last commit.
>>
>> Regards,
>>
>> --
>> Benoît Minisini.
>>
>
> Excellent , thank you Ben , it works a treat :)
>

Except one glitch..
If you do not use a format that uses quality but you pass the quality
argument in any way it gives an error so the quality arg needs to be
omitted.

I had to do something like this...

Public Sub Make PicStr(hPic As Picture, sFormat As String, Optional
iQuality As Integer) As String

  Dim sPic As String
  If sFormat = "jpg" Or If sFormat = "jpeg" Then
    sPic = hPic.Tostring(sFormat, iQuality)
  Else
    sPic = hPic.ToString(sFormat)
  Endif

  Return sPic

End

I do not know if any other formats support quality (i thought only jpeg)

Respects, and thanks again :)
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240103/f3f6108e/attachment-0001.htm>


More information about the User mailing list