tags:

views:

75

answers:

2

I am converting some GUI code I originally wrote using the win32 API, to use QT.

I have come accross some items for which I cant find any direct equivalents. They are:

  1. GetRValue
  2. GetGValue
  3. GetBValue
  4. PS_SOLID PS_DASH
  5. PS_DOT
  6. PS_DASH_DOT
  7. PS_NULL
  8. MulDiv
  9. HBITMAP

Any help?

[Edit]

I am building on Ubuntu 9.10

+2  A: 

QColor class has methods red(), green(), blue().

BrushStyle enum defines different brush patterns.

You can code MulDiv yourself, it just "multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value"

QBitmap is Qt bitmap class.

Nikola Smiljanić
+1  A: 

If you are not very concerned about performance, implement MulDiv using 64 bit integers:

 long MulDiv(long v1, long v2, long v3)
 {
     return (long)(((long long)v1*(long long)v2) / v3);
 }
extropy