Thursday, January 21, 2016

Cara Merubah Warna Background & Tulisan Pada DEV C++

Script Warna Pada DEV C++
Output Sript Warna
ikhzanews; hi guys, hari ini saya akan memposting script untuk melihat warna-warna yang dapat di gunakan dalam DEV C++, dan bagaimana cara melakukannya apabial ingin membuatnya terlihat seperti gambar, LET'S TRY :)

Script  dasar :

#include<windows.h>
#include<conio.h>
#include<iostream>
using namespace std;
void setcolor(unsigned short color)
{
    HANDLE hCon= GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hCon,color);
}

int main()

{
    int i;
    for(i=0;i<300;i++)
    {
        setcolor(i);
        cout<<"Warna"<<i <<"\t";
    }
getch();
}


Script untuk memubuat gambar :

#include<windows.h>
#include<conio.h>
#include<stdio.h>
#include<iostream>
using namespace std;
void setcolor(unsigned short color)
{
    HANDLE hCon= GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hCon,color);
}

int main()

{
setcolor(187);printf("                                                                                                                                   \n") ;                                                            
setcolor(187);printf("                                                                                                                                   \n") ;                                                            
setcolor(187);printf("             ");setcolor(204);printf(".:::rv2F0kFv,");setcolor(187);printf("                                                                         \n");
setcolor(187);printf("            ");setcolor(204);printf("PZ2viirvLU208@B@B");setcolor(187);printf("   ");setcolor(170);printf("              ");setcolor(187);printf("                                                                             \n");
setcolor(187);printf("           ");setcolor(204);printf("r8Lr:::r7YJ1SqZ@@@");setcolor(187);printf("   ");setcolor(170);printf(" .               ");setcolor(187);printf("                                                                                       \n");
setcolor(187);printf("           ");setcolor(204);printf("Zu7:::irLLu1PqOB@u");setcolor(187);printf("   ");setcolor(170);printf(" @BZi         :BU");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("          ");setcolor(204);printf("iqvi:::i7LuUFPZO@B");setcolor(187);printf("   ");setcolor(170);printf("1B@B@OEU7;i::7L5Z@");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("          ");setcolor(204);printf("qu7i,:i77Ju1SZ8@Bu");setcolor(187);printf("   ");setcolor(170);printf("B@ZPS5U5JLrirr7Y@X");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("         ");setcolor(204);printf("rE7r:::r7LY25XZMB@");setcolor(187);printf("   ");setcolor(170);printf("2@ONF1YYv7;i:i;7S@");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("         ");setcolor(204);printf("Gur:::rvYY5kqEOB@J");setcolor(187);printf("   ");setcolor(170);printf("@BOS5UJv7ii:i;rLBF");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("        ");setcolor(204);printf("7Euj77LY5S0O@B@M@B");setcolor(187);printf("   ");setcolor(170);printf("FBMqkuULv;r::ii71@");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("        ");setcolor(204);printf("Oki:         LO@@F");setcolor(187);printf("   ");setcolor(170);printf("B@EX5ULLrri:irL@u");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("           ..::.      u     ");setcolor(187);printf("");                          setcolor(170);printf("N@BES1uL7r;:,:irvkB");setcolor(187);printf("                                                                             \n");
setcolor(187);printf("       ");setcolor(153);printf("LU5urivvU1q8@B@2");setcolor(187);printf("");setcolor(187);printf("@B@MNUjv7ri,::i7kBk");setcolor(187);printf("                                                                                     \n");
setcolor(187);printf("      ");setcolor(153);printf("7BZvi,ir7vYUPEBB@B");setcolor(187);printf("  ");setcolor(238);printf(":kZ8Nk2J77JFSPvi");setcolor(187);printf("                                                                                         \n");
setcolor(187);printf("      ");setcolor(153);printf("BEJr,:ir7LY2kZM@BO");setcolor(187);printf("  ");setcolor(238);printf("MJ       ...    ");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("     ");setcolor(153);printf("@u7:::r7vvU5E8@B@");setcolor(187);printf("   ");setcolor(238);printf("7@OOkL,         .7@");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("     ");setcolor(153);printf("@0Yi::irvvY2PEMB@P");setcolor(187);printf("  ");setcolor(238);printf("MOku2jJLvii:,,::iNu");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("    ");setcolor(153);printf("7@27i,:i77LuFqMB@B");setcolor(187);printf("  ");setcolor(238);printf("LMPjjv7r;i:...,.:iB");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("    ");setcolor(153);printf("BEYr,:ir7LY5XEM@BX");setcolor(187);printf("  ");setcolor(238);printf("O81uLvrr::,.....:Xj");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("   ");setcolor(153);printf("r@27iirYjSFX0MM@B@");setcolor(187);printf("  ");setcolor(238);printf("YMS1YY7ri:,....,:iB");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("   ");setcolor(153);printf("@BZ1Y;7ir7L5MB@B@S");setcolor(187);printf("  ");setcolor(238);printf("BZ1jYv7ii:,....,iSu");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("   ");setcolor(153);printf("J.            i@B");setcolor(187);printf("  ");setcolor(238);printf("1BXUjv7ri::.....:r@n");setcolor(187);printf("                                                                              \n");
setcolor(187);printf("                      ");setcolor(238);printf("B@P5JL7ri:.. :OJ  .");setcolor(187);printf("                                                                                                        \n");
setcolor(187);printf("                       ");setcolor(238);printf("rSPquLri,..::vUX2 ,");setcolor(187);printf("                                                                              \n");                                                         
setcolor(187);printf("                                                                                                                                   \n");                                                             
setcolor(187);printf("                                                                                                                                   \n") ;                         
setcolor(187);printf("                                                                                                                                   \n") ;
getch();
}

0 comments:

Post a Comment