- void CESP::DrawGradientBox(int x, int y, int w, int h, Color clr1, Color clr2)
- {
- if(y == 0) y = 1;
- int dif_r = 0, dif_g = 0, dif_b = 0, dif_a = 0;
- dif_r = clr1.r() - clr2.r();
- dif_g = clr1.g() - clr2.g();
- dif_b = clr1.b() - clr2.b();
- dif_a = clr1.a() - clr2.a();
- int r_perpxl, g_perpxl, b_perpxl, a_perpxl;
- r_perpxl = h / dif_r;
- g_perpxl = h / dif_g;
- b_perpxl = h / dif_b;
- a_perpxl = h / dif_a;
- for(int i = y, j = 1; i <= y+h, j <= h+1; i++, j++)
- {
- g_pMatSystemSurface->DrawSetColor(clr1.r() + (r_perpxl * j), clr1.g() + (g_perpxl * j), clr1.b() + (b_perpxl * j), clr1.a() + (a_perpxl * j));
- g_pMatSystemSurface->DrawLine(x, y + j, x + w, y + j);
- g_pMatSystemSurface->DrawG
- }
- }
Undefined
By: Guest | Date: Dec 4 2009 16:20 | Format: None | Expires: never | Size: 723 B | Hits: 871
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago