Welcome! Log In Create A New Profile

Advanced

WB22 - Image Properties

Posted by André Labuschagné 
André Labuschagné
WB22 - Image Properties
July 19, 2018 01:37AM
Hi All

I am wanting to change the opacity and brush color of an image in a looper at runtime.

Has anyone managed to do this?

Cheers
André
Ericus
Re: WB22 - Image Properties
July 19, 2018 02:03AM
Hi Andre

I'm assuming you already created a new attribute in your looper i.e. ATT_Color and the control of that new attribute point to your image in the looper. Then you change the property of your new attribute to the feature you want to control. I normally work with WB19 and I don't see opacity and brush color as properties that you can change but maybe in WB22.

WB19 has Color and Background Color properties.

Regards



Ericus Steyn
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 03:00AM
Hi Ericus

Tried everything mate. All I am wanting to do is have different sort of filters over the image depending on different conditions. Opacity with some different colouration would work well but it is read only. Colour does not work. Nothing seems to work. The first thing I need to do is when there is mouse over change the colour or background colour so that there is a perceptible difference. With the other fancy stuff such as transitioning and shadows [no idea they are] but nada.

Cheers
André
Piet van Zanten
Re: WB22 - Image Properties
July 19, 2018 09:39AM
Hi André,

A mouseover effect can be created using the style of the image.
You can create a style with a thick border.
On the regular tab the border has the same color as the background and on the mouseover tab it can be any color you choose.

And now for some ranting, you can skip this part, it does not contribute to solving your problem smiling smiley:
The Webdev styles have been implemented in a most peculiar way.
Probably because it had to look and feel the same as Windev it ended up being ridiculous: there are local styles, Webdev styles and css styles.
The css styles are hidden somewhere below and can not be edited directly, only via the Webdev styles.
The result is very unproductive and hard to understand.
I have had occasions where I duplicated a Webdev style based on a css style. Then I modified the duplicated style and it also changed the css style, so the original style was modified too. When a style is applied to a control, the local settings are not overwritten. So you can set a css border, but the local border settings will remain.
Ever tried to set the text aligning of the first column of a table to center? I dare you. (I needed to insert a dummy column to get this done)
Very time consuming...

Kind regards,
Piet
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 12:11PM
Hi Piet

I have never worked with image styles. I will look at them now.

I have encountered the first column text aligning issue and have also used a dummy column there or another column that is read only and not visible and has width of 1.

I am quite aware of the different approach that WB has taken but am finding it hugely productive and it gives me an acceptable solution in the end. I am not too interested in fluff or eye candy but more in functionality - substance over form as we say in the world of accounting and auditing.

Cheers
André
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 12:14PM
Hi Piet

I have obviously with the style of an image control but have never added a list of styles to choose from that can be selected at runtime. Is that possible?

Cheers
André
Fabrice Harari
Re: WB22 - Image Properties
July 19, 2018 01:23PM
Hi andré,

I doubt you will be able to modify your image DIRECTLY in the looper, as possible attributes are limited

However, nothing prevents you to:
- load a second time your image in a hidden image control outside of the looper
- use the dmodifyxxxx functions to perform changes to your image
- reload your looper image control with the modified image

Best regards
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 02:30PM
Hi Fabrice

That is a brilliant idea - except I have no idea how to do it.

Can I not assign the hidden image control the value of the image in the looper? And then assign it back after making the changes? Do I have to write this to disk? If so - how do I load the image dynamically into the hidden control and then get it back into the looper?

Doing some reading to see how this could be done. If I can avoid going to disk that would be great.

Cheers
André
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 03:05PM
Hi Fabrice

It seems to work on two images [source and target] outside the looper that I am testing on. But the image size is a problem. When it redraws the image it seems to be displaying the top upper left of the original image even though I have it set to stretched. It does this even if I do not have a target and get it redraw again in the source image.

If I can get this to work I should have a solution.

Cheers
André
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 03:22PM
Hi

Anyone know how to load an image into an image control with WB?

Cheers
André
DerekT
Re: WB22 - Image Properties
July 19, 2018 03:27PM
André

Place one or more image controls off the window so not visible at runtime.
This way the images are loaded when the window opens.
Say Image01 and Image02

Assign each of these controls with the required image- Image01 will have the same content as the image loaded in each looper control row.

In the looper code window add 2 sections.....
'Entry in rollover of' MyLooper
//Change image
MyLooper[LooperSelect(MyLooper)].lprImage1..Value = Image02


'Exit from rollover of' MyLooper
/Change image
MyLooper[LooperSelect(MyLooper)].lprImage1..Value = Image01
This of course only works on the currently select row so you will need to duplicate the 'in rollover' in the 'row select'

The above is in the code block of the Looper not the Image.
You can make the same changes to the image code but I have found that this is ignored at runtime for some reason.

I should add that I have this running in WD - No idea if it would work in WB or WM



Edited 1 time(s). Last edit at 07/19/2018 03:28PM by DerekT.
André Labuschagné
Re: WB22 - Image Properties
July 19, 2018 03:58PM
Hi Derek

Thanks but....

WB - not WD.

Cheers
André
InfosPilot
Re: WB22 - Image Properties
July 26, 2018 02:57PM
Do not be angry but I do not really understand what you want in particular, do you have a website that can look at what you need
In WB you can do a lot of it.
Give us your code, shoot the screen to see what you want?

myimage = fWebDir() + "/images/mypicture.jpg"



Edited 1 time(s). Last edit at 07/26/2018 03:04PM by InfosPilot.
André Labuschagné
Re: WB22 - Image Properties
July 26, 2018 08:44PM
Hi InfosPilot

Got it sorted. Thanks.

Cheers
André
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: