Img in sw: the very lowest level of engagement?

I have - sort of - studied the image chapter in the manual… It’s sort of wide, large and complete!

What’s the absolute easiest way to manage images in a software? I only want these two icons. Drag-and-drop works and I can, using code, turn on and off the layer, the Canvas1 and Canvas2. Would that be the easiest way?

What kind of solution would you suggest!? Not the most clean or perfect… The easiest and most lazy solution?
I’m a pragmatic programmer… and I don’t always follow the book! As said in the presentation

To do what?

If you drag these images into your project, they might be called cross and tick
You can apply them to a button’s picture property, or you can use drawpicture to display them at a location in a paint event
You can set the transparency to ‘white’ by changing their properties in the inspector pane.

Do you want them as buttons?
Do you want something to happen when clicked?
You you want them to appear and disappear?

I’m using Windows and drag-and-drop works from within windows.
Cross and tick?
They’re named Canvas1 and Canvas2.

No interaction in this case, but interaction is not the question, it’s the images.

I will try!
Thank you for advice!

Looks like you found it :slight_smile:

Oh yea?

It could be… I’m writing … to challenge my thoughts!
As long as it’s working, then I’m happy! The nice touch, the perfect code, the beautiful result all comes later.

Images is a quite large chapter and I’m not creating an advanced image manipulation software.
Like any other person, I need to pass the 10.000 error stage… It’s a long way to walk! :slight_smile: I’m getting there!

New problem:

I use the code “” to open the window with the setting.
But the second time, nothing happens…
I now try and I test, it seems as if the “open” event is only run once!

The second time when I’m opening the window, the code inside the “open” event is not executed!
What do I do!? How do I solve that!?

This could be it?
Oh, there are so many things to learn!!!

This is not the ultimate solution. There is no need to call the database each time the window is active… (Becomes active.)
There is no such thing as Window.refresh?

No, not refresh…
Hmm…!! This must be a common issue!? To open windows inside the application! How do you do to solve it? The settings…?

This will more explain the problem:
Maybe I write bad?

  1. Enter data.
  2. Enter new data… but the previous data is inside the Window!

OK, no-one relplied!
I thhing i have the solution.
When levaing the computer, all the bright ideas comes to life…!

I put the code either when pressing the text (and readin the DB as well) or in the button.
I think the button would be the best, out of logic reasons, but also, the text is easier and alo logic… because the DB is open and already in “read” mode.

Well. I’m not home at the moment. I will try tomorrow! Thank you!!

[quote=144175:@Jakob Krabbe]I use the code “” to open the window with the setting.
But the second time, nothing happens…
I now try and I test, it seems as if the “open” event is only run once![/quote]
You are opening the window properly with the “OwnerSecretCode.Show” command. If the window stays open and never closes, there is no other “Open” event that will be triggered, therefore whatever code you have in there will not execute again.

The Activate event is slightly different … as the Language Reference points out:

But without seeing what code you’re trying to execute in the Open event, or having a better understanding of just what it is that you’re trying to accomplish, I can’t say anything beyond that.

I would be asking you the same things Jeff did:

[quote=144134:@Jeff Tullin]Do you want them as buttons?
Do you want something to happen when clicked?
You you want them to appear and disappear?[/quote]

Du har mycket att lära sig … Lycka till!

Thank you for the reply!
I’m getting there!! :slight_smile:

When doing other things, AFK (away from keyboard) the bright ideas arrives!
I’m not that lost…!

The “open” command is only triggered once, the first time the Window open. It was the surprise for me.
Instead, I edit the fields inside the Window and THEN open it… and the new and correct data will show.

The images is fine. Not perfect, but fine enough.
Just two Canvas, hiding and showing. I will look into more advanced image manipulation later. It’s not a priority.

I can not send any source code, because I’d like to keep the OwnerSecretCode secret… !
Apart from that, I don’t mind sending source code.

Thank you for all advice! Great!!

I think the easiest way to show a picture in a Canvas is it’s Backdrop property. Just assign the Picture you want it to show and you’re done.

Instead of Canvas1 and Canvas2 I’d use a single Canvas (IsVerifiedCanvas) and switch it’s backdrop.

To show the red cross…
IsVerifiedCanvas.Backdrop = RedCrossImage

To show the green checkmark…
IsVerifiedCanvas.Backdrop = GreenCheckImage

To not show any image (hide it) assign nil…
IsVerifiedCanvas.Backdrop = nil

Thank’s Will!
It make sense. It was solutions like that I really was looking for!
To hide and show the images is… sort of poor or unpleasantly desperate way of coding!
I’ll change right away! :slight_smile:

Usually I bring problems to the forum. Now, for a change, I bring the solution!
(Shitty design, really… but I’ll get to that part, Eventually… I hope!!)