How can i draw an image on screen?

gui

#1

So i was trying to make a gain vst and it worked out great. Then i decided to try to add som astetics. I made some pictures i was going to print but then i realized i don’t know how to draw images. And i can’t find a tutorial on it either. Can someone help me?


#2

Take a look at ImageCache and Graphics::drawImage()


#3

I’ve read it, but i don’t fully understand it. Can you give me an example? Especialy the ImageCache i don’t understand. @Achder


#4
 imageKnob = ImageCache::getFromMemory(BinaryData::knob_png, BinaryData::knob_pngSize);

paint method:
  g.drawImage(imageKnob, 0, 0, button.getWidth(),button.getHeight(), 0, 0, imageKnob.getWidth(), imageKnob.getWidth());
  
declaration:
Image imageKnob;

#5

from the paint method i get this error: Use of undeclared identifier ‘BinaryData’
@nseaprotector


#6

with this sample code you need to include the image in the binary by the projucer.
my GitHub sample code


#7

Thanks for the awnser. It’s much apreciated!

Jacob