Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <winnt.h>
- #include <stdio.h>
- #include "stdafx.h"
- using namespace std;
- //void Colour (int A[0][0] ,int start ,int end);
- int main()
- {
- cout<<"Hello World";
- int A[3][3] = { 1,1,3, 2,4,3, 2,100,6};
- //Colour(A[][3],3,3);
- int min = A[0][0];
- int max = A[3][3];
- int RGBcolour = 0;
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- for ( i=0; i < 480 ; i++)
- {for (j=0; j < 844; j++)
- { //Calculating for individual elements the RGBcolours
- int temp = A[i][j];
- RGBcolour = (temp*255)/max;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),RGBcolour);
- cout << temp << " ";
- }
- }
- return 0;
- }
- /*
- void Colour (int A[0][0] , int start ,int end)
- { //QuickSort(A[][j],start,end); // we need to sort first in order to apply the color
- //setting the min and max value as min and max respectively as we know the min value is (0,0,0) and max is (255,255,255)
- int min = A[0][0];
- int max = A[3][3];
- int RGBcolour = 0;
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- for ( i=0; i < 480 ; i++)
- {
- for (j=0; j < 844; j++)
- { //Calculating for individual elements the RGBcolours
- int temp = A[i][j];
- RGBcolour = (temp*255)/max;
- SetConsoleTextAttribute(hConsole,RGBcolour);
- cout << temp << " ";
- }
- }
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement