Page 3 of 4

Re: How to know the attributes of a pixel in the image

Posted: Mon Mar 30, 2015 7:54 am
by Eugene Lutsenko
Thank you very much!

Re: How to know the attributes of a pixel in the image

Posted: Mon Mar 30, 2015 9:16 am
by Eugene Lutsenko
Thank you very much, Roger! Everything works perfectly and makes even Belsch than I expected. This will allow me to do what I wanted.

Re: How to know the attributes of a pixel in the image

Posted: Mon Mar 30, 2015 1:30 pm
by Eugene Lutsenko
skiman wrote:Hi,

It looks as the freeimage wrapper isn't on the webboard.

I uploaded a ZIP with everything: DLL, sample prg and documentation. There is a section 'Pixel access functions' in the manual.

http://www.abowebhosting.be/download/freeimage.zip
Thank you, skiman!

Looked documentation. In my opinion, everything is done very well, a good set of features. But could not do anything to compile and run. Assembling project test1.xpj does not work. This is the newest version?

PS
I have a file that describes the structure of the system "Aidos", but it is in Russian.

Re: How to know the attributes of a pixel in the image

Posted: Mon Mar 30, 2015 1:52 pm
by Auge_Ohr
Eugene Lutsenko wrote:But could not do anything to compile and run. Assembling project test1.xpj does not work. This is the newest version?
what Xbase++ Version do you use :o
those 2 PRG are only "Wrapper" for FreeImage.dll so it MUST work with all Xbase++ Version except Alaska have change C-API :roll:

p.s. include ot4xb is Version 1.4.201.49 so update to lates 1.6.0.167 http://www.xbwin.com

Re: How to know the attributes of a pixel in the image

Posted: Mon Mar 30, 2015 2:03 pm
by Eugene Lutsenko
Auge_Ohr wrote:
Eugene Lutsenko wrote:But could not do anything to compile and run. Assembling project test1.xpj does not work. This is the newest version?
what Xbase++ Version do you use :o
those 2 PRG are only "Wrapper" for FreeImage.dll so it MUST work with all Xbase++ Version except Alaska have change C-API :roll:

p.s. include ot4xb is Version 1.4.201.49 so update to lates 1.6.0.167 http://www.xbwin.com

Perhaps this is too much for me. While I will try to do that gave Roger. Basically, he gave what I lacked in the standard set of graphical functions Alaska.

Re: How to know the attributes of a pixel in the image

Posted: Wed Apr 01, 2015 5:54 am
by Eugene Lutsenko
Hi, Roger!

Your program works fine and does what I need. But I can not use it in your system. It seems to me that this is due to the following snippet of text that I do not understand. Understand the exact function and the way to implement them I do not know. When you try to insert your program in which I develop, compile-time error that I could not overcome.

Code: Select all

#command  GDIFUNCTION <Func>([<x,...>]) ;
       => ;
FUNCTION <Func>([<x>]);;
STATIC scHCall := nil ;;
IF scHCall == nil ;;
  IF snHdll == nil ;;
    snHDll := DllLoad('GDI32.DLL') ;;
  ENDIF ;;
  scHCall := DllPrepareCall(snHDll,DLL_STDCALL,<(Func)>) ;;
ENDIF ;;
RETURN DllExecuteCall(scHCall,<x>)

GDIFUNCTION GetPixel( nHDC, x, y)
GDIFUNCTION SetPixel( nHDC, x, y, n )
DLLFUNCTION GetWindowDC( hwnd ) USING STDCALL FROM USER32.DLL
[/size]

Re: How to know the attributes of a pixel in the image

Posted: Wed Apr 01, 2015 6:05 am
by rdonnay
The command GDIFUNCTION was written to create an interface to the Windows API functions: GetPixel() and SetPixel().
Normally, this would be done with DLLFUNCTION, but that would be slower because it would have to call DllPrepareCall() every time GetPixel() or SetPixel() is called. The STATIC variable makes this unnecessary and therefore faster.

Your problem is probably that you are not including DLL.CH.

Add the following to the top of your code:

#include "DLL.CH"

Re: How to know the attributes of a pixel in the image

Posted: Wed Apr 01, 2015 8:09 am
by Eugene Lutsenko
No, that's not it. These things I understand. I'll try to understand itself. If not, then I will ask to help.

Re: How to know the attributes of a pixel in the image

Posted: Wed Apr 01, 2015 8:17 am
by rdonnay
Tell me what compile error you are getting.

Re: How to know the attributes of a pixel in the image

Posted: Wed Apr 01, 2015 9:28 am
by Eugene Lutsenko
Just what I read. There's just been a redefinition of the function. Everything worked! THANK YOU!

Image

Now, based on this, I will do what is intended. By the way, how do you know what the dimension of the image file (in pixels)?