This commit is contained in:
zakarya 2019-12-11 12:47:49 +01:00
parent cbf7c4a578
commit 442e680156
5 changed files with 53 additions and 11 deletions

View File

@ -75,54 +75,96 @@ int main(){
vkvm::registerEvent(vkvm::Timer, [](){
std::cout <<"picture" << std::endl;
vkvm::Color backgroundColor = vkvm::getBackgroundColor();
for(int i = 0; i<1000; i++) {
Imagedisplay imagedisplay("../src/P6.bmp");
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++) {
vkvm::setMode(vkvm::GraphicMode(2));
unsigned int a ;
a = imagedisplay.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
outPutPixel(vkvm::getHeight() ,vkvm::getWidth());
sleep(5);
sleep(3);
vkvm::setDefaultValues();
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++) {
vkvm::setMode(vkvm::GraphicMode(4));
unsigned int a ;
a = imagedisplay.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(3);
vkvm::setDefaultValues();
Imagedisplay imagedisplay2("../src/P8.bmp");
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++) {
vkvm::setMode(vkvm::GraphicMode(3));
unsigned int a ;
a = imagedisplay2.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(5);
sleep(3);
vkvm::setDefaultValues();
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++) {
vkvm::setMode(vkvm::GraphicMode(4));
unsigned int a ;
a = imagedisplay2.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(3);
vkvm::setDefaultValues();
Imagedisplay imagedisplay3("../src/P9.bmp");
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++){
vkvm::setMode(vkvm::GraphicMode(3));
unsigned int a ;
a = imagedisplay3.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(5);
sleep(3);
vkvm::setDefaultValues();
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++) {
vkvm::setMode(vkvm::GraphicMode(4));
unsigned int a ;
a = imagedisplay3.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(3);
vkvm::setDefaultValues();
Imagedisplay imagedisplay4("../src/P10.bmp");
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++){
vkvm::setMode(vkvm::GraphicMode(3));
unsigned int a ;
a = imagedisplay4.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(5);
sleep(3);
vkvm::setDefaultValues();
for (int w = 0; w < vkvm::getWidth(); w++) {
for (int h = 0; h < vkvm::getHeight(); h++){
vkvm::setMode(vkvm::GraphicMode(4));
unsigned int a ;
a = imagedisplay4.getPixel(w, h);
vkvm::setPixel(w,h,vkvm::Color(a));
}
}
sleep(3);
outPutPixel(vkvm::getHeight() ,vkvm::getWidth());
}
});
@ -130,12 +172,12 @@ int main(){
}
void outPutPixel(int windowHeight, int windowWidth) {
for(int y = 0; y < windowHeight; y++) {
for(int x = 0; x < windowWidth; x++) {
if(vkvm::getPixel(x, y).getRed() !=0) {
std::cout << "*";
std::cout << "*" ;
} else {
std::cout << " ";
}

BIN
src/font1.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
src/test.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 KiB

BIN
src/test1.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 KiB

BIN
src/test2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB