Question: I'm using this code to display an image of a gif that has an image of an Ace of Spade. However, the image is coming
I'm using this code to display an image of a gif that has an image of an Ace of Spade. However, the image is coming back in reverse and I'm not sure why can anyone help?
function [] = demo() global quitGame; quitGame = false; global click click = false;
[mainAxis, HERO, heroplot, HERO_W, HERO_H, axisTitle] = initialize_graphics();
line(50+[0 25 25 0 0],[0 0 25 25 0]); %draw a box
print_title(axisTitle,'Move the mouse or type q to quit');
while ~quitGame pause(0.025); %won't run without this mousePos = get_mouse_position(mainAxis); draw_object(mainAxis, HERO, heroplot, HERO_W, HERO_H, mousePos); %draw an Ace of Clubs if the mouse is clicked if click == true [my_image, my_colormap] = imread('cards_gif\c1.gif'); %omit my_colormap for jpeg card = ind2rgb(my_image, my_colormap); %omit this statement for jpeg image('xData',0,'yData',0,'CData',card); fprintf('The Ace of clubs has %d rows and %d columns ',size(card,1),size(card,2)); click = false; end end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
