[Gambas-user] PictureBox and Containers strange behaviour

Gianluigi bagonergi at gmail.com
Sat Dec 1 14:04:34 CET 2018


Hi Fabien,
very interesting, excellent result and little work :-D

My problem is to adapt a sequence of images of different format and type in
a single film-like image (to be clear).
I thought about doing so, this is just the first part of the code (now I
use the mouse wheel just to try), I do not think I can adapt your code here.

The idea (idiot) came to me from a question on our forum and so I would
like to build an image viewer that shows a random image like a slot
machine, now I start to study how to give it the movement (I do not know if
two images series are enough).
You can lose a lot of money by betting us over ;-D

Regards
Gianluigi

Il giorno sab 1 dic 2018 alle ore 08:44 Fabien Bodard <gambas.fr at gmail.com>
ha scritto:

> Hi dear friend
>
> This is the same with less work ;-)
>
> Regards
>
> Fabien Bodard
>
> Le ven. 30 nov. 2018 à 16:30, Gianluigi <bagonergi at gmail.com> a écrit :
>
>> Finally it works
>> See attached file
>>
>> Reagards
>> Gianluigi
>>
>> Il giorno ven 30 nov 2018 alle ore 15:39 Gianluigi <bagonergi at gmail.com>
>> ha scritto:
>>
>>> This is the correct code (?):
>>>
>>> [code]Private Sub Scale(img As Image)
>>>
>>>   Dim w, h As Integer
>>>
>>>   w = img.W
>>>   h = img.H
>>>   If h > w Then
>>>     $H = PictureBox1.H
>>>     $W = (PictureBox1.H * w) \ h
>>>     If $W > PictureBox1.W Then
>>>       $W = PictureBox1.W
>>>       $H = (PictureBox1.W * $H) \ $W
>>>       $X = PictureBox1.X
>>>       $Y = PictureBox1.Y + ((PictureBox1.H - $H) \ 2)
>>>       Return
>>>     Endif
>>>     $Y = PictureBox1.Y
>>>     $X = PictureBox1.X + ((PictureBox1.W - $W) \ 2)
>>>   Else
>>>     $W = PictureBox1.W
>>>     $H = (PictureBox1.W * h) \ w
>>>     If $H > PictureBox1.H Then
>>>       $H = PictureBox1.H
>>>       $W = (PictureBox1.H * $W) \ $H
>>>       $Y = PictureBox1.Y
>>>       $X = PictureBox1.X + ((PictureBox1.W - $W) \ 2)
>>>       Return
>>>     Endif
>>>     $X = PictureBox1.X
>>>     $Y = PictureBox1.Y + ((PictureBox1.H - $H) \ 2)
>>>   Endif
>>>
>>> End [/code]
>>>
>>> Although I would love to be able to create a code capable of scaling
>>> images on the Form_Resize event
>>> A task too burdensome for my tired brain.
>>>
>>> Regards
>>> Gianluigi
>>>
>>> Il giorno ven 30 nov 2018 alle ore 13:10 Gianluigi <bagonergi at gmail.com>
>>> ha scritto:
>>>
>>>> I need to paint an image in a new image and then show it in a
>>>> picturebox.
>>>> The thing seems to work correctly only if the picturebox is the only
>>>> component on the window.
>>>> If the hbox is present, the image is deformed (stretching) and the
>>>> lower part of the image is positioned under the hbox.
>>>> Am I wrong?
>>>> I attach a project and two explanatory images (with magnifying glass).
>>>>
>>>> Regards
>>>> Gianluigi
>>>>
>>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>
>
>
> --
> Fabien Bodard
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20181201/33c47979/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SlotImages-test1-0.0.1.tar.gz
Type: application/gzip
Size: 13747 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20181201/33c47979/attachment-0001.gz>


More information about the User mailing list