Hi guys,
I am drawing a huge image into a small control. It can only be completely viewed by moving the view rectangle.
However, I want the screenshot function to export the whole image...
This code doesn't work:
//Clear
testRender->Clear();
//Get the view to modify it later
sf::View view = testRender->GetView();
//Make the Window bigger to fit the image
testRender->SetSize(Image1->GetWidth(),Image1->GetHeight());
//Return to root position & scale
testRender->SetPosition(0,0);
Sprite1->SetScale(1,1);
//This makes the sprite contain the whole image
Sprite1->SetSubRect(sf::Rect<int>(0,0,Image1->GetWidth(),Image1->GetHeight()));
//Draw the whole image to the window
testRender->Draw(*Sprite1);
testRender->SetActive( true );
//Display the whole image
view.SetFromRect(sf::Rect<float>(0,0,Image1->GetWidth(),Image1->GetHeight()));
testRender->SetView(view);
//Capture it (should show the whole huge image)
testRender->Capture().SaveToFile("test.jpg");
It still only displays the top left corner of the huge image which is stored in "Image1" in the code. I want to capture the whole image...
I appreciate your help.
Greetings
Zipper