電腦壁紙小游戲代碼
A. pascal能夠調用電腦中圖片製作彩色程序嗎
http://upload.programfan.com/upfile/200702241053371.zip
(該程序必須在使用了CRT UNIT補丁的Turbo Pascal上運行)
我自己用pascal寫的幾個小游戲,其中的紙牌和泡泡龍調用了16色的bmp圖片
你可以參考一下.
理論上Pascal可以調用所有圖片類型,但只能通過低級代碼來自行書寫
而且顯示時Pascal(Turbo)為16色的.
感謝UpLoad.ProgramFan.com的網路空間
B. 新UI怎麼把電腦里的圖片弄到游戲背景里
之前實現了在figure上把圖片做為背景,現在實現在Guide上實現。
其實很簡單,就是在Fcn的地方添加以下代碼:
ha=axes(;units;,;normalized;,;position;,[0 0 1 1]);
uistack(ha,;down;)
II=imread(;禾木01.bmp;);
image(II)
colormap gray
set(ha,;handlevisibility;,;off;,;visible;,;off;);
另外如果要把那些按鈕等的背景也改變,也是在此處添加相應代碼就可。
比如下面代碼把按鈕的背景改變了(此方法已有人在論壇發過帖子,請自己搜索):
I=imread(;buttoncdata.bmp;);
set(handles.pushbutton1,;cdata;,I);
C. 我變了一個推箱子的代碼,可不知道如何加入圖片和音樂,請求高人指點
推箱子小游戲代碼,包含音樂,換圖功能,同時可以進行滑鼠或鍵盤操作-Sokoban game code, including music, for map features, at the same time can be a mouse or keyboard operation
[MoveNut.rar] - 推箱子游戲,無密碼可解壓。 經典游戲一個,歡迎大家下載。
[tftp_server_linux.rar] - linux下的tftp源代碼,比較經典的一個,好東西大家分享
[ProxyService.rar] - 用socket做的代理程序,對於外網連內網很有用
[tuixz.rar] - 這個程序基本實現了推箱子的所有功能,加入了背景音樂,有5首背景音樂可供 選擇,並可以跳關、選關等,並且可以無限悔步,一直悔到當前關卡的開始狀態。
[mine60.rar] - Java推箱子游戲(一共有50關卡,帶好聽的音效),完整版源碼,圖形界面,看上去夠專業。界面和泡泡堂游戲有點相似,學習游戲編程的JAVA朋友值得一看。
D. 用VB製作拼圖游戲,求代碼
Dim a(0 To 5) As Integer
Private Sub crearnd() '隨機分配分割後的圖片
Randomize
For i = 0 To 5
a(i) = Int(Rnd * 6)
If i >= 2 Then
For j = 0 To i - 1
If a(j) = a(i) Then
i = i - 1
End If
Next
End If
Next
End Sub
Private Sub Form_Load()
For i = 0 To 5
Picture2(i).Width = Picture1.Width / 3
Picture2(i).Height = Picture1.Height / 2
Next i
End Sub
Private Sub spi_CLICK()
crearnd
Picture2(a(0)).PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2
Picture2(a(1)).PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, Picture1.ScaleWidth / 3, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2
Picture2(a(2)).PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, 2 * Picture1.ScaleWidth / 3, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2
Picture2(a(3)).PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, 0, Picture1.ScaleHeight / 2, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2
Picture2(a(4)).PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2
Picture2(a(5)).PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, 2 * Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2, Picture1.ScaleWidth / 3, Picture1.ScaleHeight / 2
Picture2(0).Move Picture1.Width, 0
Picture2(1).Left = Picture1.Width + Picture2(0).Width: Picture2(1).Top = 0
Picture2(2).Left = Picture1.Width + Picture2(0).Width + Picture2(1).Width: Picture2(2).Top = 0
Picture2(3).Left = Picture1.Width: Picture2(3).Top = Picture2(0).Height
Picture2(4).Left = Picture1.Width + Picture2(3).Width: Picture2(4).Top = Picture2(1).Height
Picture2(5).Left = Picture1.Width + Picture2(3).Width + Picture2(4).Width: Picture2(5).Top = Picture2(2).Height
End Sub
Private Sub Picture2_DragDrop(index As Integer, Source As Control, X As Single, Y As Single)
Dim PIC As StdPicture
Set PIC = Source.Image
Set Source.Picture = Picture2(index).Image
Set Picture2(index).Picture = PIC
End Sub
在窗體上建立一個picture1和一個picture2(index)控制項數組,總共包含6個圖片框,然後給所有的圖片框的autoredraw屬性設置為true,就ok了,費了我好的勁,有問題再給我說
至於你要求的界面,我沒看見你的圖啊
已經發送,請查收
E. 請問java游戲怎麼加入一個背景圖。請給我代碼。謝謝
你說的如果是java swing程序,有兩種方法,1、JPanel上放背景;2、JLabel放背景
//初始化窗口
publicvoidinitFrame(){
//利用JPanel添加背景圖片
GImage=newJPanel(){
protectedvoidpaintComponent(Graphicsg){
ImageIconicon=newImageIcon("image\benbenla.jpg");
Imageimg=icon.getImage();
g.drawImage(img,0,0,icon.getIconWidth(),
icon.getIconHeight(),icon.getImageObserver());
jframe.setSize(icon.getIconWidth(),icon.getIconHeight());
}
};
jframe.setTitle("測試背景圖片");
jframe.add(GImage);
jframe.pack();
jframe.setVisible(true);
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
ImageIconicon=newImageIcon("image\benbenla.jpg");
icon.setImage(icon.getImage().getScaledInstance(icon.getIconWidth(),
icon.getIconHeight(),Image.SCALE_DEFAULT));
System.out.println(icon.getIconHeight()+""+icon.getIconWidth());
jlpic.setBounds(0,0,1366,768);
jlpic.setHorizontalAlignment(0);
jlpic.setIcon(icon);
jframe.setSize(1366,768);
jframe.add(jlpic);
jframe.pack();
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jframe.setVisible(true);
F. 求java小游戲源代碼
[最佳答案] 連連看java源代碼 import javax.swing.*; import java.awt.*; import java.awt.event.*; pu... int x0=0,y0=0,x=0,y=0,fristMsg=0,secondMsg=0,validateLV; //游戲按鈕的位...
G. 電腦代碼壁紙怎麼設置
你首先找到這樣的圖片,再網上下一個,然後右鍵將該圖片設置為壁紙
H. steam壁紙引擎代碼怎麼執行的
Steam上的Wallpaper Engine(桌面引擎),提供了桌面動態壁紙(3D,視頻,Web頁面)的商店功能,用戶可以出售或購買壁紙,而且它佔用的內存小,可根據系統運行的程序進行自動調節。
操作方法
01
安裝Steam在steampowered網站上現在Steam安裝包,下載完成後直接運行SteamSetup.exe文件進行軟體安裝,安裝完成後後運行Steam,系統會自動聯網進行下載更新。
02
創建Steam賬號後登陸Steam,在商店搜索Wallpaper Engine,該軟體需要18元人民幣
03
通過搜索引擎搜索並下載 Wallpaper Engine破解版本進行安裝,下載後運行對應的程序,如果提示缺少dll文件,只需要將對應的dll下載,解壓後放在系統目錄下,不同系統類型的電腦系統目錄位置不同:64位系統的,將下載好的.dll文件放在 C:\Windows\SysWOW64目錄;32位系統的,將下載好的.dll文件放在 C:\Windows\System32
04
打開Wallpaper Engine程序:wallpaper3.exe,選擇左邊的背景圖作為桌面背景,同時可以設置回放速度和主題顏色,確認設置後可以返回桌面可以看到動態的桌面圖案
05
打開外部視頻文件作為桌面背景,這里我選擇「使命召喚2」的視頻作為桌面背景
I. C語言製作小游戲時怎麼添加圖片音樂,代碼怎麼打
添加音樂還是比較麻煩的
一個簡單的思路是
先找一個開源的播放器代碼
或者直接搞一個播放器介面的庫
然後
把背景音樂存成文件,
在打開游戲的時候
創建線程進行播放。
代碼編寫:
PlaySound
The
PlaySound
function
plays
a
sound
specified
by
the
given
filename,
resource,
or
system
event.
(A
system
event
may
be
associated
with
a
sound
in
the
registry
or
in
the
WIN.INI
file.)
BOOL
PlaySound(
LPCSTR
pszSound,
HMODULE
hmod,
DWORD
fdwSound
);
Parameters
pszSound
A
string
that
specifies
the
sound
to
play.
If
this
parameter
is
NULL,
any
currently
playing
waveform
sound
is
stopped.
To
stop
a
non-waveform
sound,
specify
SND_PURGE
in
the
fdwSound
parameter.
Three
flags
in
fdwSound
(SND_ALIAS,
SND_FILENAME,
and
SND_RESOURCE)
determine
whether
the
name
is
interpreted
as
an
alias
for
a
system
event,
a
filename,
or
a
resource
identifier.
If
none
of
these
flags
are
specified,
PlaySound
searches
the
registry
or
the
WIN.INI
file
for
an
association
with
the
specified
sound
name.
If
an
association
is
found,
the
sound
event
is
played.
If
no
association
is
found
in
the
registry,
the
name
is
interpreted
as
a
filename.
hmod
Handle
of
the
executable
file
that
contains
the
resource
to
be
loaded.
This
parameter
must
be
NULL
unless
SND_RESOURCE
is
specified
in
fdwSound.
fdwSound
Flags
for
playing
the
sound.
The
following
values
are
defined:
SND_APPLICATION
The
sound
is
played
using
an
application-specific
association.
SND_ALIAS
The
pszSound
parameter
is
a
system-event
alias
in
the
registry
or
the
WIN.INI
file.
Do
not
use
with
either
SND_FILENAME
or
SND_RESOURCE.
SND_ALIAS_ID
The
pszSound
parameter
is
a
predefined
sound
identifier.
SND_ASYNC
The
sound
is
played
asynchronously
and
PlaySound
returns
immediately
after
beginning
the
sound.
To
terminate
an
asynchronously
played
waveform
sound,
call
PlaySound
with
pszSound
set
to
NULL.
SND_FILENAME
The
pszSound
parameter
is
a
filename.
SND_LOOP
The
sound
plays
repeatedly
until
PlaySound
is
called
again
with
the
pszSound
parameter
set
to
NULL.
You
must
also
specify
the
SND_ASYNC
flag
to
indicate
an
asynchronous
sound
event.
SND_MEMORY
A
sound
event's
file
is
loaded
in
RAM.
The
parameter
specified
by
pszSound
must
point
to
an
image
of
a
sound
in
memory.
SND_NODEFAULT
No
default
sound
event
is
used.
If
the
sound
cannot
be
found,
PlaySound
returns
silently
without
playing
the
default
sound.
SND_NOSTOP
The
specified
sound
event
will
yield
to
another
sound
event
that
is
already
playing.
If
a
sound
cannot
be
played
because
the
resource
needed
to
generate
that
sound
is
busy
playing
another
sound,
the
function
immediately
returns
FALSE
without
playing
the
requested
sound.
If
this
flag
is
not
specified,
PlaySound
attempts
to
stop
the
currently
playing
sound
so
that
the
device
can
be
used
to
play
the
new
sound.
SND_NOWAIT
If
the
driver
is
busy,
return
immediately
without
playing
the
sound.
SND_PURGE
Sounds
are
to
be
stopped
for
the
calling
task.
If
pszSound
is
not
NULL,
all
instances
of
the
specified
sound
are
stopped.
If
pszSound
is
NULL,
all
sounds
that
are
playing
on
behalf
of
the
calling
task
are
stopped.
You
must
also
specify
the
instance
handle
to
stop
SND_RESOURCE
events.
SND_RESOURCE
The
pszSound
parameter
is
a
resource
identifier;
hmod
must
identify
the
instance
that
contains
the
resource.
SND_SYNC
Synchronous
playback
of
a
sound
event.
PlaySound
returns
after
the
sound
event
completes.
Return
Values
Returns
TRUE
if
successful
or
FALSE
otherwise.
Remarks
The
sound
specified
by
pszSound
must
fit
into
available
physical
memory
and
be
playable
by
an
installed
waveform-audio
device
driver.
PlaySound
searches
the
following
directories
for
sound
files:
the
current
directory;
the
Windows
directory;
the
Windows
system
directory;
directories
listed
in
the
PATH
environment
variable;
and
the
list
of
directories
mapped
in
a
network.
For
more
information
about
the
directory
search
order,
see
the
documentation
for
the
OpenFile
function.
If
it
cannot
find
the
specified
sound,
PlaySound
uses
the
default
system
event
sound
entry
instead.
If
the
function
can
find
neither
the
system
default
entry
nor
the
default
sound,
it
makes
no
sound
and
returns
FALSE.
QuickInfo
Windows
NT:
Requires
version
3.1
or
later.
Windows:
Requires
Windows
95
or
later.
Windows
CE:
Unsupported.
Header:
Declared
in
mmsystem.h.
Import
Library:
Use
winmm.lib.
Unicode:
Implemented
as
Unicode
and
ANSI
versions
on
Windows
NT.
See
Also
Waveform
Audio
Overview,
Waveform
Functions
J. 如何將swf文件做電腦壁紙
將swf文件做成電腦壁紙的方法:
1、建立內嵌Flash動畫的超文本文件。如:flash.htm
打開記事本,輸入以下代碼:
<html>
<body>
<embed src"flash.swf" width=1024 height=768>
</embed><br>
</body>
</html>
其中:width=1024 height=768 分別代表內嵌網面的Flash動畫文件顯示的寬度和高度。Flash.swf是代表該Flash動畫文件名。這些參數和名稱可以根據用戶的屏幕設置情況和Flash文件情況有所改變。確認原代碼無誤後,將這個純文本文件以文件名後輟為HTM或HTML的形式保存起來,最好用瀏覽器打開這個文件,看看瀏覽器中否正常顯示Flash動畫。
2、將內嵌Flash動畫文件的超文本設置為活動桌面
右擊桌面然後點擊「屬性」,再點擊web選項卡,確認已選中按"web頁方式查看活動桌面"復選框。再點擊「背景」選項卡,點擊「瀏覽」定位剛才創建的超文本文件地址,然後點「確定」按鈕。這樣桌面就形成了。