Compiler can't able to find definition of Rectangle.
please check the following,
1. Whether header file included or not where Rectangle() definition is there.
2. Check corresponding header file path added in Include Directories (-I).
NOTE : First find which header file holds Rectangle() definition
I've checked on MSDN, and it says it needs a Rectangle.
1 2 3 4 5 6 7 8 9 10 11
public:
void DrawImage(
Image^ image,
Rectangle destRect,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
GraphicsUnit srcUnit,
ImageAttributes^ imageAttr
)
Point me at the msdn link where you got that information from - there is some confusion here.
You maybe reading the wrong funtion prototype on msdn.
But while we are sorting that out - see if the following helps:
1 2
Rect rect(x_pos, y_pos, x_pos+56, y_pos+56); //create a Rect structure
g.DrawImage((&music, & rect, x_pos, y_pos, 56, 56, UnitPixel, &imgattr);
**Rect is in the Gdiplus namespace - but I think you already have written a using namesace Gdiplus directive **
d:\dokumenter\programmering\visual c++\media player\media player\flow_menu.h(139): error C2664: 'Gdiplus::Status Gdiplus::Graphics::DrawImage(Gdiplus::Image *,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::REAL,Gdiplus::Unit)' : cannot convert parameter 2 from 'Gdiplus::Rect *' to 'Gdiplus::REAL'
1> There is no context in which this conversion is possible
When I was looking at the GDIplus stuff, that DrawImage function has 16 overloads.
You may need to be a bit more precise in our choice and quantity of parameters.
Hmm... everything works besides this part. I'm considering changing to another graphic libary with hardware acceleration, unless there is another way to do alpha blending with GDI+?