Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
Can you loadFromImage to RenderTexture?
Print
Pages: [
1
]
Author
Topic: Can you loadFromImage to RenderTexture? (Read 1613 times)
0 Members and 1 Guest are viewing this topic.
LordNani
Newbie
Posts: 12
Can you loadFromImage to RenderTexture?
«
on:
May 28, 2019, 11:54:51 am »
image.create(windowWidth, windowHeight, sf::Color::White);
sf::RenderTexture canvas;
sf::IntRect area = sf::IntRect(0, 0, image.getSize.x, image.getSize.y);
canvas.getTexture().loadFromImage(image,area);
I need it so I can open and edit images.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Can you loadFromImage to RenderTexture?
«
Reply #1 on:
May 28, 2019, 12:50:11 pm »
The texture of the RT cannot be accessed like this, it's read-only. Instead, load the image into a texture and draw it to your RT with a sprite.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
Can you loadFromImage to RenderTexture?