Results 1 to 12 of 12

Thread: can't reuse a pure c++ .h file's methods and classes

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: can't reuse a pure c++ .h file's methods and classes

    You should stick to RGB32.
    The problem is in line 31 of the code you posted:
    Qt Code:
    1. pixel = rgbImage(x,y);
    To copy to clipboard, switch view to plain text mode 
    As before, you can't assign that directly.
    First convert it to qRgb, using qRed, etc...
    It is the reverse transformation of what you did before.

    EDIT: Actually, I think it is better to use the macros from your header to extract the components and build a qRgb:
    Qt Code:
    1. #define RED(pixel) ((pixel) & 0xff)
    2. #define GREEN(pixel) (((pixel)>>8) & 0xff)
    3. #define BLUE(pixel) (((pixel)>>16) & 0xff)
    To copy to clipboard, switch view to plain text mode 

    Regards

  2. The following user says thank you to marcel for this useful post:

    sincnarf (4th October 2007)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.