IF a$="a" then …
IF a$="b" then …
DIM a as string*1
Select Case cbyte(a)
Case &H0
StrText = "NOP"
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim rgn As Long ' région Dim Xleft As Integer Dim Xright As Integer Dim X As Integer Dim Y As Integer Dim Ybottom As Integer Dim Transparence As Single Dim Opacite As Single Dim fx As Single Dim fy As Single rgn = CreatePolygonRgn(Vertices(0), Vertex, Winding) Call GetObject(Graph(n).Image, Len(PicInfo), PicInfo) ReDim ImageArray(3, (PicInfo.bmWidth - 1), (PicInfo.bmHeight - 1)) As Byte Noctets = PicInfo.bmWidth * PicInfo.bmHeight * 4 Call GetBitmapBits(Graph(n).Image, Noctets, ImageArray(0, 0, 0)) ' Copie image dans array For X = Xleft To Xright ' Abscisses min et max du polygone à dessiner For Y = Y1 To Ybottom ' Ordonnées min et max du polygone à dessiner If PtInRegion(rgn, X, Y) <> 0 Then Transparence = 1 - Opacite ImageArray(0, X, Y) = (ImageArray(0, X, Y) * Transparence) + (CC3 * Opacite) ImageArray(1, X, Y) = (ImageArray(1, X, Y) * Transparence) + (CC2 * Opacite) ImageArray(2, X, Y) = (ImageArray(2, X, Y) * Transparence) + (CC1 * Opacite) End If Next Y Next X Call SetBitmapBits(Graph(n).Image, Noctets, ImageArray(0, 0, 0)) ' Copie array dans image Call DeleteObject(rgn)Ce qui prend le plus de temps est (3 fois)
Sub Test3()
Dim x, y As Integer
Dim Image0(3000, 3000) As Byte
Dim Image1(3000, 3000) As Byte
Dim Image2(3000, 3000) As Byte
CopyMemoryByte Image0(0, 0), Image3D(0, 0, 0), 3000 + 1
CopyMemoryByte Image1(0, 0), Image3D(1, 0, 0), 3000 + 1
CopyMemoryByte Image2(0, 0), Image3D(2, 0, 0), 3000 + 1
For x = 0 To 3000
For y = 0 To 3000
Image0(x, y) = (x + y) And 255
Image1(x, y) = (x + y) And 255
Image2(x, y) = (x + y) And 255
Next y, x
CopyMemoryByte Image3D(0, 0, 0), Image0(0, 0), 3000 + 1
CopyMemoryByte Image3D(1, 0, 0), Image1(0, 0), 3000 + 1
CopyMemoryByte Image3D(2, 0, 0), Image2(0, 0), 3000 + 1
End Sub
Private Declare Sub CopyMemoryByte Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)
Dim Image3D(2, 3000, 3000) As Byte
'-------------------------------------
Erase Image3D
Dim Image4((3001 ^ 2 * 3) - 1) As Byte ' image(2,3000,3000)=>3*3000*3000=3000^2*3
For x = 0 To ((3001 ^ 2 * 3) - 1) Step 3
Image4(x) = (x) And 255 ' tableau 1: image(0,x,x)
Image4(x + 1) = (x) And 255 ' tableau 2: image(1,x,x)
Image4(x + 2) = (x) And 255 ' tableau 3: image(2,x,x)
Next x
CopyMemoryByte Image3D(0, 0, 0), Image4(0), (3001 ^ 2 * 3) + 1
14 juil. 2019 à 15:11
14 juil. 2019 à 15:27
https://fr.wikipedia.org/wiki/Pointeur_(programmation)#Arithm%C3%A9tique_des_pointeurs