How to know the attributes of a pixel in the image

This forum is for general support of Xbase++
Message
Author

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#22 Post 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.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#23 Post 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.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

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

#24 Post 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
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#25 Post 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.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#26 Post 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]

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

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

#27 Post 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"
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#28 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

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

#29 Post by rdonnay »

Tell me what compile error you are getting.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#30 Post 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)?

Post Reply