Files
crushFX/Source/CrushSliderLook.cpp
ESCA111 a2faa1955f init
innit
2026-01-20 12:56:34 +13:00

24 lines
1.0 KiB
C++

/*
==============================================================================
CrushSliderLook.cpp
Created: 16 Jan 2026 9:40:57pm
Author: esca
==============================================================================
*/
#include "CrushSliderLook.h"
#include "BinaryData.h"
void CrushSliderLook::setImages(){
bg = juce::ImageCache::getFromMemory(BinaryData::crushslidebg_png, BinaryData::crushslidebg_pngSize);
fg = juce::ImageCache::getFromMemory(BinaryData::crushslidefg_png, BinaryData::crushslidefg_pngSize);
}
void CrushSliderLook::drawLinearSlider(juce::Graphics &g, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, juce::Slider::SliderStyle sliderStyle, juce::Slider &slider ){
g.drawImage(bg, 0, 0, 205, 43, 0, 0, 205, 43, false); //draw background
float fraction = (sliderPos-minSliderPos)/(width);
int fgWidth = (int)(205*fraction);
g.drawImage(fg, 0, 0, fgWidth, 43, 0, 0, fgWidth, 43, false);
}