Public?Class?Form1
創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供資源網(wǎng)站建設(shè)、資源做網(wǎng)站、資源網(wǎng)站設(shè)計、資源網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、資源企業(yè)網(wǎng)站模板建站服務(wù),十余年資源做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。
Dim?pArray?As?New?ArrayList()
Private?Sub?Form1_Load(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?MyBase.Load
For?i?=?1?To?7?'7個picturebox變數(shù)組?
Dim?pic?As?New?PictureBox()
pic.Image?=?Image.FromFile(Application.StartupPath??"\image\rred.jpg")
pArray.Add(pic)
Next?'改變第二個背景圖片?
Me.BackgroundImage?=?CType(pArray(1),?PictureBox).Image
'pArray(1).BackgroundImage?=?Image.FromFile(Application.StartupPath??"\image\rred.jpg")
End?Sub
End?Class
用一個全局變量保存這個1.jpg,如變量a,你按按鈕2時,可以簡單的在a中插入一個"A",如a.SubString(0, a.Length-4) "A" a.SubString(a.Length-4),這樣就能把例如"C:/Images/1.jpg"變成"C:/Images/1A.jpg"
我的做法是先寫入一個圖片變量,然后再寫入到容器上。容器設(shè)置雙緩沖
還有你說的控件必須透明不太明白,可以直接在容器上繪圖,不需要控件,圖片的透明度可以用RGBA色的A值(透明度)來控制
我這個也是實時翻滾刷新的,不會閃!
REM?假設(shè)存在Image類型變量img?
Dim?bmp?As?Bitmap?=?CType(img,?Bitmap)?'先將Image類型強(qiáng)制轉(zhuǎn)換為Bitmap類型?
bmp.Save("C:\1.png",?System.Drawing.Imaging.ImageFormat.Png)?'以PNG格式存儲到C:\1.png
Dim curSqlstr As String = "INSERT INTO Picture(picture_id, picture_area)" _
"VALUES('" (i + 1).ToString() "','@picture_area ')"
你看這句中的,'@picture_area ')",多個單引號了,被當(dāng)成VARCHAR處理了.去了單引號才是變量.
Public Class Form1
Private TPS As Integer
Private TPPath() As String '定義不確定元素個數(shù)組,及動態(tài)數(shù)組
Private Sub LoadPhoto()
'將圖片路徑及圖片名加載到數(shù)組
Dim JS As Integer '計數(shù)用
For Each foundFile As String In My.Computer.FileSystem.GetFiles(CurDir() "\職員圖片")
TPS = TPS + 1 '將圖片數(shù)存入變量中
Next
ReDim TPPath(TPS - 1) '確定數(shù)組大小
For Each FoundFile As String In My.Computer.FileSystem.GetFiles(CurDir() "\職員圖片")
'將圖片路徑存入數(shù)組
TPPath(JS) = FoundFile
JS = JS + 1
Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadPhoto()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = TPPath.Length '獲取數(shù)組大小
Label1.Text = TPPath(1) '獲取數(shù)組中第2個元素的值
End Sub