Hi,
I would want to open a new screen and display an image (using datatype or not). I read the docs but it is not clear enough for me (especially displaying images).
It is surely an obvious question. This will change a little from questions about guis !
Thanks,
YesCop
Do you want to add an image to a GUI? Or do you just want to draw it anywhere on screen? For the former Reaction has an image class. If it's the latter that you're after, then load the image using datatypes, extract the image's bitmap (converting it to the screen's pixel-format), and use the graphics library to blit that onto the screen. If you use CompositeTags(), then you can even scale/warp the image.
I don't have any example code, sorry. However, have a look at the picture datatype and graphics library's documentation. If you're still stuck then post back here with more specific questions.
Hans
Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work
Hi Hans,
I thank you for our reply, I will take a look.
My purpose is to open a new screen and load an image as background.
No gui, no window.
If you have some examples, I will accept these with ease.
YesCop
I wrote this article years ago, "Display an image on a private screen" :
http://www.gurumed.net/index.php/Exemple_d'affichage_d'une_image_sur_un_écran_privé
I don't know if it needs an update but at least you can start with this example.
Bonjour/hello Corto,
I was happy when I read your post but I became sad because the link is dead...
If you have a copy of your article, please free to post it here or send it to me.
YesCop
@YesCop
Don't click on the link, copy the address from "http:" all the way to "écran_privé" and paste it in your browser's address box. It works.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
Hi Trixie,
Thanks. I have just found it.
The link is http://www.gurumed.net/index.php/Exemple_d%27affichage_d%27une_image_sur_un_%C3%A9cran_priv%C3%A9
@corto and YesCop
You should use the url tag for long links like that as otherwise they break the forum page layout.
The format for bbcode url tag is (remove the spaces before and after the square brackets to make it work):
[ url=http://your/url/here ] short-label-here [ /url ]
I'd like to see some examples pasted here. Even simple things like how to put an image in reaction, Window Background, Screen Background, etc.
On a side note, is there a place to put code snippets on this site?
Adding an image to a ReAction layout is very simple (just use LAYOUT_AddImage to add a bitmap.image object).
This is the code I used to create the GUI in IPS-O-Matic f.e.:
Interesting.
I see you give the filename of the picture.
So if I understand well, the bitmap will be created by windowobject. I thought I was obliged to use some calls with datatypes objects to retrieve the bitmap.
By the way, Trixie will be unhappy with you, you are not using the NEW laws !! :)
What is created is a BOOPSI image object (bitmap.image is a subclass of imageclass). The reason you don't need to concern yourself with datatypes or anything like that is because the bitmap.image class takes care of all this work for you. A BOOPSI image is essentially an image that knows how to draw itself when a certain method is called on it.
The code is several years old. There's probably a lot of other things in there that I would do differently now.
Hi All,
I've taken a crack at the code from the URL listed and I've run in to some snags. The code will compile, just some warnings about calls to quit. When I run it I see the following output:
Opened libraries
Created datatype object
got GetDTAttrs
Then I the grim, "module display-photo at 0x7FC50488 (section 5 @ 0x468)"
I hope it's ok to post the code here.
@YesCop
No, I hereby pardon him :-)
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
You crash because all your interface pointers are NULL. You can only call datatypes functions because you misspelled IDataTypes as IDatatypes (with lower-case t), so that the actual IDataTypes is correctly initialized by libauto.
You should remove all library and interface declarations from the code as well as the calls to OpenLibrary and CloseLibrary.
Or alternately keep the Open and CloseLibrary calls but add correct calls to GetInterface and DropInterface and don't link with libauto.
What library should be inlcuded in order to make this to work?
Thank you