Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "image.c"
- //#include "image.h"
- int main(int argc, char *argv[])
- {
- int s;
- int x,y,v,size[2];
- struct Image obraz;
- do {
- printf("Wybierz jedna z opcjii:\n1 - stworz obraz\n2 - wypelnij obraz kolorem\n3 - odczytaj wartosc piksela\n4 - zmien wartosc piksela\n5 - odczytaj rozmiar obrazu\n6 - usun obraz\n\n");
- scanf("%i",s);
- switch(s)
- {
- case 1:
- printf("\nPodaj szerokosc obrazu: "); scanf("%i",x);
- printf("\nPodaj wysokosc obrazu: "); scanf ("%i",y);
- obraz=CreateImage(x,y);
- break;
- case 2:
- printf("\nPodaj wartosc koloru: "); scanf("%i",v);
- fillInImage(&obraz,v);
- break;
- case 3:
- printf("\nPodaj nr wiersza: "); scanf("%i",x);
- printf("\nPodaj nr kolumny: "); scanf("%i",y);
- byte res=Read(&obraz,x,y);
- printf("\n\nWartosc koloru w podanym pikselu to: %c",res);
- break;
- case 4:
- printf("\nPodaj nr wiersza: "); scanf("%i",x);
- printf("\nPodaj nr kolumny: "); scanf("%i",y);
- printf("\nPodaj wartosc koloru: "); scanf("%i",v);
- Write(&obraz,x,y,v);
- break;
- case 5:
- size[2]=Size(&obraz);
- printf("\n\nRozmiar obrazu:\nSzerokosc: %i",size[0]);
- printf("\nWysokosc: %i",size[1]);
- break;
- case 6:
- Delete(&obraz);
- /*if (obraz=NULL) {
- printf("\n\nObraz zostal usuniety.");
- }
- else {
- printf("\n\nBlad usuwania obrazu");
- }*/
- break;
- }
- }
- while (getch()!=27);
- @h@ system("PAUSE"); bad
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement