How to display external images within Ctrlr?

Home Forums General Panels, Components, Macros How to display external images within Ctrlr?

Tagged: 

This topic contains 10 replies, has 4 voices, and was last updated by Possemo Possemo 4 months, 2 weeks ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #83185
    goodweather
    goodweather
    Participant
    • Topics: 39
    • Replies: 374
    • Total: 413
    • ★★

    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 🙂

    #83188
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 539
    • Total: 552
    • ★★★

    Hi 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 :))

    #83189

    dasfaker
    Keymaster
    • Topics: 79
    • Replies: 784
    • Total: 863
    • ★★★

    In 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.

    #83205
    goodweather
    goodweather
    Participant
    • Topics: 39
    • Replies: 374
    • Total: 413
    • ★★

    Well, 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 1 year, 1 month ago by goodweather goodweather.
    #83214

    dasfaker
    Keymaster
    • Topics: 79
    • Replies: 784
    • Total: 863
    • ★★★

    At 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.

    #83310
    goodweather
    goodweather
    Participant
    • Topics: 39
    • Replies: 374
    • Total: 413
    • ★★

    I 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.

    #83313

    dasfaker
    Keymaster
    • Topics: 79
    • Replies: 784
    • Total: 863
    • ★★★

    No, 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.

    #92129

    T3X
    Participant
    • Topics: 0
    • Replies: 2
    • Total: 2

    You can add images in the resource tab on the left side.
    How to make them move NO IDEA.

    #92130
    goodweather
    goodweather
    Participant
    • Topics: 39
    • Replies: 374
    • Total: 413
    • ★★

    You 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 – Render

    #92132

    T3X
    Participant
    • Topics: 0
    • Replies: 2
    • Total: 2

    Ok thanks going to view the demo render, love to get it all to work for my Korg R3 and manipulate the settings in FLStudio.

    #92147
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 539
    • Total: 552
    • ★★★

    I 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 4 months, 2 weeks ago by Possemo Possemo.
Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

There is currently 0 users and 28 guests online
No users are currently active
Forum Statistics
Threads: 2,212, Posts: 15,604, Members: 55,374
Most users ever online was 12 on January 22, 2019 3:47 pm
Do NOT follow this link or you will be banned from the site!