To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Display Modes
Old Apr 25th, 2007, 12:19 PM   #1
IvanRJ
New Member
 
Join Date: Apr 07
Posts: 2
IvanRJ is an unknown quantity at this point (<10)
[RESOLVED] Help - Using While plus IF and image.pictures

Hi all,

I need to get picture by picture from a directory e insert into a image.picture.
One of them could have a size higher, like 598x50, and that picture I need to insert at image(5).picture.

The next loop from the same directory, get another picture and the size is smaller like, if pic < M_Widht(400) then...... insert at image(5).picture.

One more loop from the same Directory, get another picture and the size is smaller like, if pic < M_Widht(400) then...... if image(1).picture has a picture on it go to insert at image(2).picture.

One more loop from the same Directory, get another picture and the size is smaller like, if pic < M_Widht(400) then...... if image(1).picture has a picture and if image(2).picture has a picture on it, go to insert at image(3).picture.

End of pictures, end of loop.

Go to next Directory and start again a new page filling up those image(n).pictures.

Iīm trying any If I know, first of all I am a newbie with V.B

I would like to thanks any person that will read this topic and help me.
I donīt have any more ideas.

thanks a lot.
Ivan
-----------------

[My code]


Private Sub Detail_Format()
Dim WFD As WIN32_FIND_DATA
'
Dim intLoop As Integer
Dim objControl As Image
'
mstrDirEntrada = "C:\Inetpub\wwwroot\DS\uploads\raat.da\" & Field28.Text & "\"
strMask = mstrDirEntrada & "*.jpg"
hArq = True
hSearch = FindFirstFile(strMask, WFD)
contador = 1
'
FlagImage1 = 0
FlagImage2 = 0
FlagImage3 = 0
FlagImage4 = 0
FlagImage5 = 0
'
Image1.Picture = Nothing
Image2.Picture = Nothing
Image3.Picture = Nothing
Image4.Picture = Nothing
Image5.Picture = Nothing
'
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
'
If hSearch <> INVALID_HANDLE_VALUE Then
While hArq
strArquivo = StripNulls(WFD.cFileName)
If Dir(mstrDirEntrada & strArquivo, vbArchive) <> "" And strArquivo <> "." And strArquivo <> ".." Then
dados = mstrDirEntrada & strArquivo
'
' Check Image n return variable m_width size
ReadImageInfo (dados)

' If Size Biger than, image1
If m_Width > 400 And cheio400 = False Then
Image1.Visible = True
Image1.Picture = LoadPicture(dados)
cheio400 = True
End If

If Image2.Visible = False And cheio = False Then
Image2.Visible = True
Image2.Picture = LoadPicture(dados)
cheio = True
End If

If Image2.Visible = True And Image3.Visible = False And cheio = False Then
Image3.Visible = True
Image3.Picture = LoadPicture(dados)
cheio = True
End If

If Image2.Visible = True And Image3.Visible = True And Image4.Visible = False And cheio = False Then
Image4.Visible = True
Image4.Picture = LoadPicture(dados)
cheio = True
End If

If Image2.Visible = True And Image3.Visible = True And Image4.Visible = True And Image4.Visible = False And cheio = False Then
Image4.Visible = True
Image4.Picture = LoadPicture(dados)
cheio = True
End If

End If

contador = contador + 1
hArq = FindNextFile(hSearch, WFD)
Wend
hArq = FindClose(hSearch)
Else
MsgBox "File not found!"
End If
Exit Sub

ERRO:
MsgBox Err.Number & " - " & Err.Description

End Sub


----------------------------------
Thanks guys.
Ivan

Last edited by IvanRJ; Apr 25th, 2007 at 02:02 PM. Reason: Change the code
IvanRJ is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:37 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.