파이썬 마을 게시판 인덱스 파이썬 마을
우리나라 파이썬 사용자들의 이야기 마을
 
 FAQFAQ   검색검색   멤버리스트멤버리스트   사용자 그룹사용자 그룹   사용자 등록하기사용자 등록하기 
 개인 정보개인 정보   비공개 메시지를 확인하려면 로그인하십시오비공개 메시지를 확인하려면 로그인하십시오   로그인로그인 
Google
python.or.kr Web

고수님들 Picture Viewer만들기라는데요...

 
글 쓰기   답변 달기    파이썬 마을 게시판 인덱스 -> 파이썬 숙제 질문과 답변
이전 주제 보기 :: 다음 주제 보기  
글쓴이 메시지
s1famej



가입:
올린 글: 7

올리기올려짐: 2010 2월 09 11:07 am    주제: 고수님들 Picture Viewer만들기라는데요... 인용과 함께 답변

Picture Viewer를 만들라는데요....

교수님이 이런식으로 만들라고 써놓으셨습니다..

고수님들 도움부탁드립니다.

•Use the caption at the top of the screen to inform the user to "Press f for Frame, p for pictures" Use pygame.display.set_caption(...)


•When f is clicked, use pygame.draw.rect(...) to draw a frame. You can get creative as follows:

for i in range (1,20, 2):
#draw an unfilled square
pygame.draw.rect(background, (255,0,0), ((200+i, 100+i), (300, 300)), 15)
pygame.draw.rect(background, (0,0,255), ((200+i+1, 100+i+1), (300, 300)), 15)

.. or you can just use a thicker line


•Each time the user presses the p key, the slide show progresses to the next image in sequence. You can store references to the images in a list, like this:

myFaceList = ["Neil1.jpg", "Neil2.jpg", "Neil3.jpg" ]

Here is a trick for cycling through a list. Below, myFaceList is the list and faceIndex is the list index.

... a loop for cycling through the slide show ..
myFace = pygame.image.load(myFaceList[faceIndex])
myFace = pygame.transform.scale(myFace, (280,280))
myFace = myFace.convert()
faceIndex += 1
faceIndex = faceIndex % len(myFaceList)


The modulus operator (in Python this is the % character) takes care of returning the index to 0 when it goes out of bounds.
위로
사용자 정보 보기 비밀 메시지 보내기    
s1famej



가입:
올린 글: 7

올리기올려짐: 2010 2월 10 3:48 am    주제: 인용과 함께 답변

이문제는 제가 만들었습니다...

관심가져주셔서 감사합니다...
위로
사용자 정보 보기 비밀 메시지 보내기    
이전 글 표시:   
글 쓰기   답변 달기    파이썬 마을 게시판 인덱스 -> 파이썬 숙제 질문과 답변 시간대: GMT + 9 시간(한국)
페이지 11

 
건너뛰기:  
새로운 주제를 올릴 수 없습니다
답글을 올릴 수 없습니다
주제를 수정할 수 없습니다
올린 글을 삭제할 수 없습니다
투표를 할 수 없습니다



Powered by phpBB © 2001, 2005 phpBB Group
회선/장비: Daum DNA , 관리: 장혜식,서상현