Home › Forums › General › Panels, Components, Macros › How to display external images within Ctrlr?
Tagged: image jpg
- This topic has 10 replies, 4 voices, and was last updated 5 years, 3 months ago by Possemo.
-
AuthorPosts
-
March 27, 2018 at 11:10 pm #83185
Hi,
does someone know how to display a .jpg image with a panel? I mean, not one coming from resources but one selected on disk.
Juce apparently allows doing this: ImageFileFormat class or JPEGImageFormat subclass; there is an ImagePreviewComponent class…We have also within Ctrlr the custom component that embeds a graphic class.
So:
– is it possible to use an external image and show it in the custom component?
– or how to use the juce functions ImageFileFormat class or JPEGImageFormat subclass
– or …???Thx for any help 🙂
March 28, 2018 at 12:39 pm #83188Hi goody,
I have no idea sorry, but I am curious – why would you want to do that? Do you want to make an image processing app with Ctrlr :))
March 28, 2018 at 2:01 pm #83189In this post Atom says what LUA classes are bound to LUA (so they work in Ctrlr). He says that you need a pair of files (.h/.cpp) in order to bound a class. The link provided is from an old Ctrlr version, so we can compare between what was there years ago and what we have today:
Old Ctrlr: https://sourceforge.net/p/ctrlrv4/code/1511/tree/nightly/Source/Lua/JuceClasses/
Actual Ctrlr: https://github.com/RomanKubiak/ctrlr/tree/master/Source/Lua/JuceClasses
In the old Ctrlr there is “LImage.cpp” file that is not present now.
You can try in Ctrlr 5.3.201, in the console, the following:
img = Image() what(img)
and you get this:
Object type [Image] ----------------------------------------------------------------- Members: moveImageSection: function multiplyAllAlphas: function isRGB: function hasAlphaChannel: function isNull: function setPixelAt: function getWidth: function duplicateIfShared: function isValid: function isARGB: function isSingleChannel: function getPixelAt: function getHeight: function rescaled: function __init: function multiplyAlphaAt: function getReferenceCount: function desaturate: function
The one you are looking for seems to be class ImageFileFormat(), but I haven’t been able to make it work.
March 28, 2018 at 10:14 pm #83205Well, I’m still using 5.3.201 because I had problems with the newer ones on my panels. Don’t remember what but 5.3.201 is fine for me and at the moment I’m not trusting the newer versions.
I was was looking to github though. Indeed in old SourceForge I can see LImage.cpp
Why would this have been removed??? It is a pain if things starts to get removed as we are building panels and they are relying on the possibilities of the platform.
That the platform evolves is fine but newer versions must absolutely be kept compatible with older ones otherwise it makes the platform unreliable!!!I’ll try what you gave. Thx dasfaker!
Need to find a way to feed the custom component with the image…
Btw, is Atom still developing Ctrlr? Can’t those Image related Juce classes not be added?
Why don’t we take the full Juce without raising questions?
It would open Ctrlr to other users/developers maybe?- This reply was modified 6 years, 1 month ago by goodweather.
March 29, 2018 at 11:06 am #83214At some point after 5.3.201 Atom started to remove stuff (maybe to rework it later in some other way) and it’s now half-finished.
It now seems that Ctrlr development is almost dead, last Atom’s code is from July. We would need a C++ developer to accomplish what you say.
April 4, 2018 at 3:43 pm #83310I have seen in Github that a guy called fredzo did the last build.
Do you know him? Maybe he could had/modify the things to have this Image() and ImageFileFormat() stuff work as foreseen in Juce.April 4, 2018 at 5:01 pm #83313No, I don’t know him. It seems he has been fixing bugs and adding features related to Ctrlr usage, but not Juce related things. I wish he could shed some light.
January 4, 2019 at 3:15 pm #92129You can add images in the resource tab on the left side.
How to make them move NO IDEA.January 4, 2019 at 3:21 pm #92130You can add images in the resource tab on the left side.
How to make them move NO IDEA.Hi, thx for your reply but this is not the issue.
With the Resources tab on the right side you had an image in the panel when building it NOT when using it as such. I’d like to be able to use an OpenFileDialog to select a file then display it in some frame within the panel.
To make it move is no problem either (if this is what you are looking): it requires a repaint() and in the repaint function you include some calculation.
You have a nice example of this in the DEMO panel called DEMO – RenderJanuary 4, 2019 at 5:18 pm #92132Ok thanks going to view the demo render, love to get it all to work for my Korg R3 and manipulate the settings in FLStudio.
January 4, 2019 at 11:39 pm #92147I am still curious for what purpose within Ctrlr you would need this?
Edit: Ok, you won’t tell it. I can live with that. I guess it has just someting to do with a “proof of concept”. Well maybe a user could choose its own background image. Now, that would be a killer feature for Ctrlr – a real game changer 😛
- This reply was modified 5 years, 3 months ago by Possemo.
-
AuthorPosts
- The forum ‘Panels, Components, Macros’ is closed to new topics and replies.