سأزعجكم (وانشط القسم قليلا :wink: ) حيث اني احاول تطبيق بعض البرامج الخاصة بالرسم باستخدام الQT .
الكود التالي:
#include <QtCore/QCoreApplication>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <QImage>
// example page 95
inline int round (const float a) {return int (a + 0.5);}
void myline ( int x0, int y0, int xEnd, int yEnd){
float dx= xEnd - x0, dy= yEnd-0, steps, k;
float xInc, yInc,x=x0,y=y0;
if (fabs(dx)>fabs(dy))
steps = fabs(dx);
else
steps = fabs(dy);
xInc = float(dx)/float(steps);
yInc = float(dy)/float(steps);
// QImage::setPixel(round(x), round(y));
setPixel(round(x), round(y));
for (k=0; k<steps; k++){
x+=xInc;
y+=yInc;
setpixel (round(x), round(y));
}
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
myline(1,1,50,50);
return a.exec();
}يعطي رسائل الخطأ التاليه
main.cpp:5: QImage: No such file or directory main.cpp:23: error: `setPixel' was not declared in this scope
معلش تحملوني شوي هاليومتين
:wub:
