Welcome! Log In Create A New Profile

Advanced

Command dStartDrawing (wd 20)

Posted by ddsd 
ddsd
Command dStartDrawing (wd 20)
May 11, 2019 10:57PM
the command doesent seem to work properly.
It can only retrieve part of the x,y image control positions(image is preloadit with no special parameters like stretch etc,..)
for example i am unable to get coler of first pixel,it just says 0
am i doing somthing wrong?

dStartDrawing(IMG_NoName1)
nPixelColor is int
nPixelColor = dPixelColor(IMG_NoName1, 1, 1)
Trace(nPixelColor)
Re: Command dStartDrawing (wd 20)
May 12, 2019 01:04PM
Hi,

Did you try the dNoErase option?

Regards,
Piet
ddsd
Re: Command dStartDrawing (wd 20)
May 12, 2019 05:47PM
hi Piet
Tried with the option dNoErase.
Same result.
Could it be i need to download latest od framework or are the dependencies normely build in?
ddsd
Re: Command dStartDrawing (wd 20)
May 13, 2019 10:13PM
any solution ?
Re: Command dStartDrawing (wd 20)
May 14, 2019 09:05AM
Hi,

You can try to load the image into an image variable. If it works, you know it is a setting of the image control you need to change.

Regards,
Piet
ddsd
Re: Command dStartDrawing (wd 20)
May 14, 2019 07:07PM
Still got the same error i uploadit gui + code
any insights why this command is not working?


Re: Command dStartDrawing (wd 20)
May 15, 2019 11:37AM
Hi,

Well, looking at the picture, there's a black P in the upper left corner.
The pixelcolor of black is 0.
So no problem here.

Regards,
Piet
ddsd
Re: Command dStartDrawing (wd 20)
May 15, 2019 05:58PM
hi
actualy x1/y1 is purple its just not big enaugh (not strechted)to see .
so problem persists,also issent coler supose to be shown in RGB?

friendly regards
Re: Command dStartDrawing (wd 20)
May 16, 2019 06:39PM
Hi,

I don't see any purple in your example.
RGB is just a function to generate a color, it cannot be returned as a result.
An RGB color is made up of 3 bytes e.g. indian red is hex #B0171F or RGB(176,23,31) or decimal 2037680.
You can easily see the RGB values in the hex number: #B0=176, #17=23 and #1F=31.
In Windev 22 I have no problem getting a pixelcolor from an image (it even works without dStartDrawing)
This has worked flawlessly even when I was using Windev 16,so I would be very surprised if it was a Windev bug.

Regards,
Piet
Re: Command dStartDrawing (wd 20)
May 17, 2019 10:38AM
Hi,

I tried your code and it works as expected over here.
No need for dStartDrawing as Piet also mentioned
Tested with WD21 and WD23 (don't have WD20 installed anymore…)
Are you sure the image itself is fine? Did you try loading other images and other x,y coordinates?

Arie
ddsd
Re: Command dStartDrawing (wd 20)
May 21, 2019 08:22PM
solved
I retried it with another image and now its working fine,

should have worked with the old image aswell double checked cordinates/coler/pix,fille,location.
i grabbed the old image of the internet perhapse it had some copy protection embeded.

thanks for the tip
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: