[Gambas-user] PictureBox and Containers strange behaviour
Gianluigi
bagonergi at gmail.com
Wed Dec 5 11:07:03 CET 2018
Hi Fabien,
excellent :-D
That's exactly what I was looking for.
Thank you very much.
(Google had inserted your email into spam, Google is really smart GRRR!)
Regards
Gianluigi
Il giorno mar 4 dic 2018 alle ore 23:08 Fabien Bodard <gambas.fr at gmail.com>
ha scritto:
> ouch not Draw.Image ... but Paint.DrawImage... Draw is Obsolete
>
> Le mar. 4 déc. 2018 à 22:59, Fabien Bodard <gambas.fr at gmail.com> a écrit :
>
>> This is a new version ... i have forget to reinit the initial position
>> when the first image reach the view top.
>>
>>
>>
>> Le mar. 4 déc. 2018 à 22:38, Fabien Bodard <gambas.fr at gmail.com> a
>> écrit :
>>
>>> Sorry for the late :-)
>>>
>>> I think this is what you are looking for :-)... and there is not picture
>>> box any more.
>>>
>>> Le sam. 1 déc. 2018 à 22:19, Fabien Bodard <gambas.fr at gmail.com> a
>>> écrit :
>>>
>>>> no
>>>> I will try to show you an example tomorow
>>>>
>>>> Le sam. 1 déc. 2018 à 19:43, Gianluigi <bagonergi at gmail.com> a écrit :
>>>>
>>>>> do you mean: Using two pictureboxes, moving and loading them to make a
>>>>> smooth movement appear?
>>>>> Ok, I'll try but not today
>>>>>
>>>>> Regards
>>>>>
>>>>> Il giorno sab 1 dic 2018 alle ore 18:57 Fabien Bodard <
>>>>> gambas.fr at gmail.com> ha scritto:
>>>>>
>>>>>> you must not load images in one image... in fact you must load each
>>>>>> image in a image variable.
>>>>>>
>>>>>> then you manage the layout during the drawing event.
>>>>>>
>>>>>> a timer trigger call the drawing area event when needed ... during
>>>>>> the move.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Le sam. 1 déc. 2018 à 18:28, Gianluigi <bagonergi at gmail.com> a
>>>>>> écrit :
>>>>>>
>>>>>>> Hi Fabien,
>>>>>>> the idea of loading images into one image was silly and I should
>>>>>>> have understood it right away.
>>>>>>> Too heavy.
>>>>>>> Aborted project.
>>>>>>>
>>>>>>> Regards
>>>>>>> Gianluigi
>>>>>>>
>>>>>>> Il giorno sab 1 dic 2018 alle ore 15:21 Fabien Bodard <
>>>>>>> gambas.fr at gmail.com> ha scritto:
>>>>>>>
>>>>>>>> Ok I seen the idea ...
>>>>>>>>
>>>>>>>> For the movement you can take a look in the FAbout of the ide code
>>>>>>>>
>>>>>>>> Le sam. 1 déc. 2018 à 14:05, Gianluigi <bagonergi at gmail.com> a
>>>>>>>> écrit :
>>>>>>>>
>>>>>>>>> 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 ]----
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>>>>>> ]----
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Fabien Bodard
>>>>>>>>
>>>>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>>>>> ]----
>>>>>>>>
>>>>>>>
>>>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>>>> ]----
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Fabien Bodard
>>>>>>
>>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>>> ]----
>>>>>>
>>>>>
>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>> ]----
>>>>>
>>>>
>>>>
>>>> --
>>>> Fabien Bodard
>>>>
>>>
>>>
>>> --
>>> Fabien Bodard
>>>
>>
>>
>> --
>> Fabien Bodard
>>
>
>
> --
> 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/20181205/e2482b64/attachment-0001.html>
More information about the User
mailing list