Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Image gets distorted when maximize button is hit
Print
Pages: [
1
]
Author
Topic: Image gets distorted when maximize button is hit (Read 1609 times)
0 Members and 1 Guest are viewing this topic.
rajhansk
Newbie
Posts: 21
Image gets distorted when maximize button is hit
«
on:
October 31, 2017, 04:54:36 am »
I have an image of 640x480. when I hit maximize button the whole image gets distorted. How do I keep the image un-stretched when window is maximized ?
Logged
achpile
Full Member
Posts: 231
Re: Image gets distorted when maximize button is hit
«
Reply #1 on:
October 31, 2017, 05:18:00 am »
void
ach
::
Game
::
processEvent
(
sf
::
Event
event
)
{
switch
(
event.
type
)
{
case
sf
::
Event
::
Resized
:
app
-
>
setView
(
sf
::
View
(
sf
::
FloatRect
(
0
,
0
, app
-
>
getSize
(
)
.
x
, app
-
>
getSize
(
)
.
y
)
)
)
;
...
or something like that
Logged
Dispersio -
http://en.sfml-dev.org/forums/index.php?topic=20444
AchBall -
https://en.sfml-dev.org/forums/index.php?topic=22570
Dispersio 2 -
http://en.sfml-dev.org/forums/index.php?topic=22171
Dispersio 3 -
https://en.sfml-dev.org/forums/index.php?topic=29723
Laurent
Administrator
Hero Member
Posts: 32498
Re: Image gets distorted when maximize button is hit
«
Reply #2 on:
October 31, 2017, 07:43:20 am »
It is also explained in the tutorial about views.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Image gets distorted when maximize button is hit
anything