2
0
Fork 0

Bitmap resize and demo conditional

This commit is contained in:
George Reales 2020-05-21 09:20:47 +02:00
parent a3c9546ace
commit 82f18790d1
3 changed files with 16 additions and 5 deletions

View file

@ -452,10 +452,8 @@ void ObxdAudioProcessorEditor::paint(Graphics& g)
const Image image = ImageCache::getFromFile(mainFile); const Image image = ImageCache::getFromFile(mainFile);
g.setImageResamplingQuality(Graphics::ResamplingQuality::highResamplingQuality);
g.drawImage (image, g.drawImage (image,
0, 0, image.getWidth()/2, image.getHeight()/2, // /2 preliminar retina support 0, 0, image.getWidth()/2, image.getHeight()/2, // TODO this resize should be done on resized()
0, 0, image.getWidth(), image.getHeight()); 0, 0, image.getWidth(), image.getHeight());
} }
else else
@ -468,4 +466,15 @@ void ObxdAudioProcessorEditor::paint(Graphics& g)
0, 0, image.getWidth(), image.getHeight(), 0, 0, image.getWidth(), image.getHeight(),
0, 0, image.getWidth(), image.getHeight()); 0, 0, image.getWidth(), image.getHeight());
} }
}
void ObxdAudioProcessorEditor::resized()
{
/* Not working
const Image image = gin::applyResize (ImageCache::getFromFile(mainFile), 0.5);
*/
} }

View file

@ -36,7 +36,8 @@ public:
void mouseUp (const MouseEvent& e) override; void mouseUp (const MouseEvent& e) override;
void paint (Graphics& g) override; void paint (Graphics& g) override;
void resized() override;
//============================================================================== //==============================================================================
void changeListenerCallback (ChangeBroadcaster* source) override; void changeListenerCallback (ChangeBroadcaster* source) override;
void buttonClicked (Button *) override; void buttonClicked (Button *) override;

View file

@ -413,10 +413,11 @@ void ObxdAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
{ {
bindings.controllers[i] = xmlState->getIntAttribute(String(i), 0); bindings.controllers[i] = xmlState->getIntAttribute(String(i), 0);
} }
#if ! DEMOVERSION
setCurrentProgram(xmlState->getIntAttribute(S("currentProgram"), 0)); setCurrentProgram(xmlState->getIntAttribute(S("currentProgram"), 0));
sendChangeMessage(); sendChangeMessage();
#endif
#if JUCE_VERSION <= JUCE_543 #if JUCE_VERSION <= JUCE_543
delete xmlState; delete xmlState;
#endif #endif