home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Thumbnails2102052162008.psc / ucThumbNails / ucThumbNails.ctl < prev   
Text File  |  2008-02-15  |  46KB  |  1,254 lines

  1. VERSION 5.00
  2. Begin VB.UserControl ucThumbNails 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00FFFFFF&
  5.    ClientHeight    =   7770
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   8595
  9.    ScaleHeight     =   7770
  10.    ScaleWidth      =   8595
  11.    Begin VB.PictureBox picPreview 
  12.       Appearance      =   0  'Flat
  13.       BackColor       =   &H80000005&
  14.       ForeColor       =   &H80000008&
  15.       Height          =   3630
  16.       Left            =   150
  17.       ScaleHeight     =   3600
  18.       ScaleWidth      =   5520
  19.       TabIndex        =   14
  20.       Top             =   1920
  21.       Visible         =   0   'False
  22.       Width           =   5550
  23.       Begin VB.Image Image1 
  24.          Height          =   1605
  25.          Left            =   1155
  26.          Top             =   1035
  27.          Width           =   1740
  28.       End
  29.    End
  30.    Begin VB.ListBox List1 
  31.       Height          =   3180
  32.       Left            =   6330
  33.       TabIndex        =   6
  34.       Top             =   270
  35.       Width           =   1635
  36.    End
  37.    Begin VB.PictureBox picPR 
  38.       Appearance      =   0  'Flat
  39.       BackColor       =   &H80000005&
  40.       ForeColor       =   &H80000008&
  41.       Height          =   225
  42.       Left            =   0
  43.       ScaleHeight     =   195
  44.       ScaleWidth      =   6120
  45.       TabIndex        =   5
  46.       Top             =   6870
  47.       Width           =   6150
  48.       Begin VB.Shape sPrBar 
  49.          BackColor       =   &H00FFFFFF&
  50.          BorderColor     =   &H0000C000&
  51.          FillColor       =   &H0000C000&
  52.          FillStyle       =   0  'Solid
  53.          Height          =   300
  54.          Left            =   -120
  55.          Top             =   -45
  56.          Width           =   120
  57.       End
  58.    End
  59.    Begin VB.PictureBox picMain 
  60.       Appearance      =   0  'Flat
  61.       BackColor       =   &H80000005&
  62.       ForeColor       =   &H80000008&
  63.       Height          =   6855
  64.       Left            =   0
  65.       ScaleHeight     =   6825
  66.       ScaleWidth      =   6120
  67.       TabIndex        =   0
  68.       Top             =   0
  69.       Width           =   6150
  70.       Begin VB.PictureBox picDisplay 
  71.          Appearance      =   0  'Flat
  72.          BackColor       =   &H00FFFFFF&
  73.          BorderStyle     =   0  'None
  74.          ForeColor       =   &H80000008&
  75.          Height          =   7665
  76.          Left            =   -15
  77.          ScaleHeight     =   7665
  78.          ScaleWidth      =   5850
  79.          TabIndex        =   2
  80.          Top             =   -15
  81.          Visible         =   0   'False
  82.          Width           =   5850
  83.          Begin VB.PictureBox picThumbNail 
  84.             Appearance      =   0  'Flat
  85.             BackColor       =   &H00FFFFFF&
  86.             BorderStyle     =   0  'None
  87.             ForeColor       =   &H80000008&
  88.             Height          =   1170
  89.             Index           =   0
  90.             Left            =   165
  91.             ScaleHeight     =   1170
  92.             ScaleWidth      =   1185
  93.             TabIndex        =   3
  94.             Top             =   90
  95.             Visible         =   0   'False
  96.             Width           =   1185
  97.          End
  98.          Begin VB.Label lblSorry 
  99.             Alignment       =   2  'Center
  100.             Appearance      =   0  'Flat
  101.             BackColor       =   &H80000005&
  102.             BackStyle       =   0  'Transparent
  103.             Caption         =   "Sorry...No pictures available."
  104.             BeginProperty Font 
  105.                Name            =   "MS Sans Serif"
  106.                Size            =   18
  107.                Charset         =   0
  108.                Weight          =   700
  109.                Underline       =   0   'False
  110.                Italic          =   0   'False
  111.                Strikethrough   =   0   'False
  112.             EndProperty
  113.             ForeColor       =   &H80000008&
  114.             Height          =   375
  115.             Left            =   750
  116.             TabIndex        =   18
  117.             Top             =   480
  118.             Visible         =   0   'False
  119.             Width           =   5070
  120.          End
  121.          Begin VB.Label lblTDim 
  122.             Alignment       =   2  'Center
  123.             Appearance      =   0  'Flat
  124.             BackColor       =   &H80000005&
  125.             BackStyle       =   0  'Transparent
  126.             Caption         =   "Label2"
  127.             ForeColor       =   &H80000008&
  128.             Height          =   210
  129.             Index           =   0
  130.             Left            =   75
  131.             TabIndex        =   17
  132.             Top             =   1515
  133.             Visible         =   0   'False
  134.             Width           =   1350
  135.          End
  136.          Begin VB.Image imgPreSize 
  137.             Height          =   330
  138.             Left            =   4050
  139.             Top             =   2115
  140.             Visible         =   0   'False
  141.             Width           =   390
  142.          End
  143.          Begin VB.Shape sFrame 
  144.             BorderColor     =   &H00000000&
  145.             Height          =   1215
  146.             Index           =   0
  147.             Left            =   135
  148.             Shape           =   4  'Rounded Rectangle
  149.             Top             =   75
  150.             Visible         =   0   'False
  151.             Width           =   1230
  152.          End
  153.          Begin VB.Label lblThumb 
  154.             Alignment       =   2  'Center
  155.             Appearance      =   0  'Flat
  156.             BackColor       =   &H80000005&
  157.             BackStyle       =   0  'Transparent
  158.             Caption         =   "Label1"
  159.             ForeColor       =   &H80000008&
  160.             Height          =   240
  161.             Index           =   0
  162.             Left            =   75
  163.             TabIndex        =   4
  164.             Top             =   1290
  165.             Visible         =   0   'False
  166.             Width           =   1350
  167.          End
  168.       End
  169.       Begin VB.VScrollBar VS1 
  170.          Enabled         =   0   'False
  171.          Height          =   6975
  172.          Left            =   5850
  173.          Max             =   100
  174.          TabIndex        =   1
  175.          Top             =   0
  176.          Width           =   285
  177.       End
  178.       Begin VB.Label lblLoading 
  179.          BackStyle       =   0  'Transparent
  180.          Caption         =   "Loading...Please Wait"
  181.          BeginProperty Font 
  182.             Name            =   "MS Sans Serif"
  183.             Size            =   13.5
  184.             Charset         =   0
  185.             Weight          =   700
  186.             Underline       =   0   'False
  187.             Italic          =   0   'False
  188.             Strikethrough   =   0   'False
  189.          EndProperty
  190.          Height          =   360
  191.          Left            =   1350
  192.          TabIndex        =   7
  193.          Top             =   3255
  194.          Visible         =   0   'False
  195.          Width           =   3255
  196.       End
  197.    End
  198.    Begin VB.Label Label1 
  199.       BackStyle       =   0  'Transparent
  200.       Caption         =   "File Size"
  201.       Height          =   195
  202.       Left            =   15
  203.       TabIndex        =   16
  204.       Top             =   7470
  205.       Width           =   645
  206.    End
  207.    Begin VB.Label lblFileSize 
  208.       Alignment       =   2  'Center
  209.       Appearance      =   0  'Flat
  210.       BackColor       =   &H80000005&
  211.       BorderStyle     =   1  'Fixed Single
  212.       ForeColor       =   &H80000008&
  213.       Height          =   240
  214.       Left            =   645
  215.       TabIndex        =   15
  216.       Top             =   7455
  217.       Width           =   930
  218.    End
  219.    Begin VB.Label Label6 
  220.       BackStyle       =   0  'Transparent
  221.       Caption         =   "Folder Size"
  222.       Height          =   210
  223.       Left            =   2130
  224.       TabIndex        =   13
  225.       Top             =   7470
  226.       Width           =   795
  227.    End
  228.    Begin VB.Label lblFolderSz 
  229.       Alignment       =   2  'Center
  230.       Appearance      =   0  'Flat
  231.       BackColor       =   &H80000005&
  232.       BorderStyle     =   1  'Fixed Single
  233.       ForeColor       =   &H80000008&
  234.       Height          =   240
  235.       Left            =   2940
  236.       TabIndex        =   12
  237.       Top             =   7455
  238.       Width           =   1050
  239.    End
  240.    Begin VB.Label Label4 
  241.       BackStyle       =   0  'Transparent
  242.       Caption         =   "Total Files"
  243.       Height          =   255
  244.       Left            =   4770
  245.       TabIndex        =   11
  246.       Top             =   7485
  247.       Width           =   735
  248.    End
  249.    Begin VB.Label Label3 
  250.       BackStyle       =   0  'Transparent
  251.       Caption         =   "Current Folder"
  252.       Height          =   195
  253.       Left            =   15
  254.       TabIndex        =   10
  255.       Top             =   7215
  256.       Width           =   1125
  257.    End
  258.    Begin VB.Label lblCurFold 
  259.       Appearance      =   0  'Flat
  260.       BackColor       =   &H80000005&
  261.       BorderStyle     =   1  'Fixed Single
  262.       ForeColor       =   &H80000008&
  263.       Height          =   240
  264.       Left            =   1065
  265.       TabIndex        =   9
  266.       Top             =   7200
  267.       Width           =   5070
  268.    End
  269.    Begin VB.Label lblFileCount 
  270.       Alignment       =   2  'Center
  271.       Appearance      =   0  'Flat
  272.       BackColor       =   &H80000005&
  273.       BorderStyle     =   1  'Fixed Single
  274.       ForeColor       =   &H80000008&
  275.       Height          =   240
  276.       Left            =   5520
  277.       TabIndex        =   8
  278.       Top             =   7455
  279.       Width           =   615
  280.    End
  281.    Begin VB.Image imgSizing 
  282.       Height          =   1095
  283.       Left            =   0
  284.       Top             =   0
  285.       Visible         =   0   'False
  286.       Width           =   1110
  287.    End
  288. End
  289. Attribute VB_Name = "ucThumbNails"
  290. Attribute VB_GlobalNameSpace = False
  291. Attribute VB_Creatable = True
  292. Attribute VB_PredeclaredId = False
  293. Attribute VB_Exposed = False
  294. Option Explicit
  295.  
  296. '*******************************************************************
  297. '**                          ThumbNail User Control
  298. '**                               Version 1.1.5
  299. '**                               By Ken Foster
  300. '**                                 January 2008
  301. '**                     Freeware--- no copyrights claimed
  302. '*******************************************************************
  303.  
  304. 'THIS CONTROL IS USING GDI+  SO MAKE SURE YOU HAVE IT ON YOUR SYSTEM
  305.  
  306. 'Credit goes to Miltiadis Kritikos for the PNG code
  307.  
  308. '*******************************************************************
  309.  
  310. '***************** Table of Procedures *************
  311. '   Private Sub UserControl_Initialize
  312. '   Private Sub UserControl_ReadProperties
  313. '   Private Sub UserControl_Resize
  314. '   Private Sub UserControl_WriteProperties
  315. '   Private Sub ClearAll
  316. '   Public Sub CreateThumbNail
  317. '   Public Sub FormDrag
  318. '   Private Sub lblThumb_Click
  319. '   Private Sub LoadList
  320. '   Private Sub LoadPics
  321. '   Private Sub picPreview_DblClick
  322. '   Private Sub picPreview_MouseDown
  323. '   Private Sub picThumbNail_MouseDown
  324. '   Private Sub SmoothForm
  325. '   Private Sub VS1_Change
  326. '   Private Sub VS1_Scroll
  327. '   Public Function GetPathSize
  328. '   Private Function ShortName
  329. '   Public Property Get BackColor
  330. '   Public Property Let BackColor
  331. '   Public Property Let FolderPath
  332. '   Public Property Get FolderPath
  333. '   Public Property Get FolderSize
  334. '   Public Property Get FontColor
  335. '   Public Property Let FontColor
  336. '   Public Property Get FullPath
  337. '   Public Property Get PicBoxBackColor
  338. '   Public Property Let PicBoxBackColor
  339. '   Public Property Get PicBoxBorderColor
  340. '   Public Property Let PicBoxBorderColor
  341. '   Public Property Get PicDimen
  342. '   Public Property Let PicDimen
  343. '   Public Property Get ProBarColor
  344. '   Public Property Let ProBarColor
  345. '   Public Property Get RndCorners
  346. '   Public Property Let RndCorners
  347. '   Public Property Get SelectedFile
  348. '   Public Property Get SelectedFolder
  349. '   Public Property Let ShowFolderInfo
  350. '   Public Property Get ShowFolderInfo
  351. '   Public Function InitGDIPlus
  352. '   Public Sub FreeGDIPlus
  353. '   Public Function LoadPictureGDIPlus
  354. '   Private Sub InitDC
  355. '   Private Sub gdipResize
  356. '   Private Sub GetBitmap
  357. '   Private Function CreatePicture
  358. '   Public Function Resize
  359. '   Private Sub FillInWmfHeader
  360.  
  361. 'GDI CODE BY MILTIADIS KRITIKOS
  362. '   Public Function InitGDIPlus
  363. '   Public Sub FreeGDIPlus
  364. '   Public Function LoadPictureGDIPlus
  365. '   Private Sub InitDC
  366. '   Private Sub gdipResize
  367. '   Private Sub GetBitmap
  368. '   Private Function CreatePicture
  369. '   Public Function Resize
  370. '   Private Sub FillInWmfHeader
  371. '***************** End of Table ********************
  372.  
  373.  
  374. Private Declare Function SetWindowRgn Lib "user32" ( _
  375.       ByVal HWND As Long, _
  376.       ByVal hRgn As Long, _
  377.       ByVal bRedraw As Long) As Long
  378. Private Declare Function CreateRoundRectRgn Lib "gdi32.dll" ( _
  379.       ByVal X1 As Long, _
  380.       ByVal Y1 As Long, _
  381.       ByVal X2 As Long, _
  382.       ByVal Y2 As Long, _
  383.       ByVal X3 As Long, _
  384.       ByVal Y3 As Long) As Long
  385. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  386. Private Declare Function ReleaseCapture Lib "user32.dll" () As Long
  387. Private Declare Function SendMessage Lib "user32.dll" _
  388.       Alias "SendMessageA" ( _
  389.       ByVal HWND As Long, _
  390.       ByVal wMsg As Long, _
  391.       ByVal wParam As Long, _
  392.       lParam As Any) As Long
  393.  
  394. Event Click()
  395. Event DblClick()
  396.  
  397. Private Const m_def_FolderPath = ""
  398. Private Const m_def_SelectedFile = ""
  399. Private Const m_def_SelectedFolder = ""
  400. Private Const m_def_FullPath = ""
  401. Private Const m_def_PicBoxBorderColor = vbBlack
  402. Private Const m_def_FontColor = vbBlack
  403. Private Const m_def_BackColor = vbWhite
  404. Private Const m_def_ShowFolderInfo = True
  405. Private Const m_def_FolderSize = ""
  406. Private Const m_def_PicBoxBackColor = vbWhite
  407. Private Const m_def_ProBarColor = vbGreen
  408. Private Const m_def_RndCorners = False
  409. Private Const m_def_IncludePNGs = True
  410. Private Const m_def_PicDimen = True
  411.  
  412. Private mvalue As Integer
  413. Private m_FolderPath As String
  414. Private m_SelectedFile As String
  415. Private m_SelectedFolder As String
  416. Private m_FullPath As String
  417. Private m_PicBoxBorderColor As OLE_COLOR
  418. Private m_FontColor As OLE_COLOR
  419. Private m_BackColor As OLE_COLOR
  420. Private m_ShowFolderInfo As Boolean
  421. Private m_FolderSize As String
  422. Private m_PicBoxBackColor As OLE_COLOR
  423. Private m_ProBarColor As OLE_COLOR
  424. Private m_RndCorners As Boolean
  425. Dim m_IncludePNGs As Boolean
  426. Dim m_PicDimen As Boolean
  427.  
  428. '---------------------For PNG files-------------------
  429. Private Type GUID
  430.    Data1    As Long
  431.    Data2    As Integer
  432.    Data3    As Integer
  433.    Data4(7) As Byte
  434. End Type
  435.  
  436. Private Type PICTDESC
  437.    size     As Long
  438.    Type     As Long
  439.    hBmp     As Long
  440.    hPal     As Long
  441.    Reserved As Long
  442. End Type
  443.  
  444. Private Type GdiplusStartupInput
  445.     GdiplusVersion           As Long
  446.     DebugEventCallback       As Long
  447.     SuppressBackgroundThread As Long
  448.     SuppressExternalCodecs   As Long
  449. End Type
  450.  
  451. Private Type PWMFRect16
  452.     Left   As Integer
  453.     Top    As Integer
  454.     Right  As Integer
  455.     Bottom As Integer
  456. End Type
  457.  
  458. Private Type wmfPlaceableFileHeader
  459.     Key         As Long
  460.     hMf         As Integer
  461.     BoundingBox As PWMFRect16
  462.     Inch        As Integer
  463.     Reserved    As Long
  464.     CheckSum    As Integer
  465. End Type
  466.  
  467. ' GDI Functions
  468. Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hDC As Long) As Long
  469. Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PICTDESC, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
  470. Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  471. Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
  472. Private Declare Function PatBlt Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As Long) As Long
  473. Private Declare Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long
  474. Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
  475. Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
  476. 'Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  477. Private Declare Function DeleteDC Lib "gdi32" (ByVal hDC As Long) As Long
  478.  
  479. ' GDI+ functions
  480. Private Declare Function GdipLoadImageFromFile Lib "gdiplus.dll" (ByVal FileName As Long, GpImage As Long) As Long
  481. Private Declare Function GdiplusStartup Lib "gdiplus.dll" (token As Long, gdipInput As GdiplusStartupInput, GdiplusStartupOutput As Long) As Long
  482. Private Declare Function GdipCreateFromHDC Lib "gdiplus.dll" (ByVal hDC As Long, GpGraphics As Long) As Long
  483. Private Declare Function GdipSetInterpolationMode Lib "gdiplus.dll" (ByVal Graphics As Long, ByVal InterMode As Long) As Long
  484. Private Declare Function GdipDrawImageRectI Lib "gdiplus.dll" (ByVal Graphics As Long, ByVal Img As Long, ByVal x As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long) As Long
  485. Private Declare Function GdipDeleteGraphics Lib "gdiplus.dll" (ByVal Graphics As Long) As Long
  486. Private Declare Function GdipDisposeImage Lib "gdiplus.dll" (ByVal Image As Long) As Long
  487. Private Declare Function GdipCreateBitmapFromHBITMAP Lib "gdiplus.dll" (ByVal hBmp As Long, ByVal hPal As Long, GpBitmap As Long) As Long
  488. Private Declare Function GdipGetImageWidth Lib "gdiplus.dll" (ByVal Image As Long, Width As Long) As Long
  489. Private Declare Function GdipGetImageHeight Lib "gdiplus.dll" (ByVal Image As Long, Height As Long) As Long
  490. Private Declare Function GdipCreateMetafileFromWmf Lib "gdiplus.dll" (ByVal hWmf As Long, ByVal deleteWmf As Long, WmfHeader As wmfPlaceableFileHeader, Metafile As Long) As Long
  491. Private Declare Function GdipCreateMetafileFromEmf Lib "gdiplus.dll" (ByVal hEmf As Long, ByVal deleteEmf As Long, Metafile As Long) As Long
  492. Private Declare Function GdipCreateBitmapFromHICON Lib "gdiplus.dll" (ByVal hIcon As Long, GpBitmap As Long) As Long
  493. Private Declare Function GdipDrawImageRectRectI Lib "gdiplus.dll" (ByVal Graphics As Long, ByVal GpImage As Long, ByVal dstx As Long, ByVal dsty As Long, ByVal dstwidth As Long, ByVal dstheight As Long, ByVal srcx As Long, ByVal srcy As Long, ByVal srcwidth As Long, ByVal srcheight As Long, ByVal srcUnit As Long, ByVal imageAttributes As Long, ByVal callback As Long, ByVal callbackData As Long) As Long
  494. Private Declare Sub GdiplusShutdown Lib "gdiplus.dll" (ByVal token As Long)
  495.  
  496. ' GDI and GDI+ constants
  497. Private Const PLANES = 14            '  Number of planes
  498. Private Const BITSPIXEL = 12         '  Number of bits per pixel
  499. Private Const PATCOPY = &HF00021     ' (DWORD) dest = pattern
  500. Private Const PICTYPE_BITMAP = 1     ' Bitmap type
  501. Private Const InterpolationModeHighQualityBicubic = 7
  502. Private Const GDIP_WMF_PLACEABLEKEY = &H9AC6CDD7
  503. Private Const UnitPixel = 2
  504. '----------------------end PNG files----------------------------
  505.  
  506. Private tmpPath As String
  507. Private prev As Boolean
  508. Dim stg As String
  509. Dim pngwidth As Long
  510. Dim pngheight As Long
  511.  
  512. Private Sub UserControl_Initialize()
  513.  
  514.    PicBoxBorderColor = m_def_PicBoxBorderColor
  515.    FontColor = m_def_FontColor
  516.    BackColor = m_def_BackColor
  517.    PicBoxBackColor = m_def_PicBoxBackColor
  518.    ShowFolderInfo = m_def_ShowFolderInfo
  519.    ProBarColor = m_def_ProBarColor
  520.    RndCorners = m_def_RndCorners
  521.    PicDimen = m_def_PicDimen
  522. End Sub
  523.  
  524. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  525.  
  526.    With PropBag
  527.       PicBoxBorderColor = .ReadProperty("PicBoxBorderColor", m_def_PicBoxBorderColor)
  528.       FontColor = .ReadProperty("FontColor", m_def_FontColor)
  529.       BackColor = .ReadProperty("BackColor", m_def_BackColor)
  530.       ShowFolderInfo = .ReadProperty("ShowFolderInfo", m_def_ShowFolderInfo)
  531.       PicBoxBackColor = .ReadProperty("PicBoxBackColor", m_def_PicBoxBackColor)
  532.       ProBarColor = .ReadProperty("ProBarColor", m_def_ProBarColor)
  533.       RndCorners = .ReadProperty("RndCorners", m_def_RndCorners)
  534.       PicDimen = .ReadProperty("PicDimen", m_def_PicDimen)
  535.    End With
  536.  
  537. End Sub
  538.  
  539. Private Sub UserControl_Resize()
  540.  
  541.    If ShowFolderInfo = True Then
  542.       UserControl.Width = picDisplay.Width + VS1.Width + 10
  543.       UserControl.Height = picMain.Height + picPR.Height + lblFolderSz.Height + 400
  544.     Else
  545.       UserControl.Width = picDisplay.Width + VS1.Width + 10
  546.       UserControl.Height = picMain.Height + picPR.Height + 30
  547.    End If
  548.    VS1.Height = picMain.Height
  549.    picDisplay.Top = picMain.Top - 10
  550.    picDisplay.Left = picMain.Left
  551. End Sub
  552.  
  553. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  554.  
  555.    With PropBag
  556.       .WriteProperty "PicBoxBorderColor", m_PicBoxBorderColor, m_def_PicBoxBorderColor
  557.       .WriteProperty "FontColor", m_FontColor, m_def_FontColor
  558.       .WriteProperty "BackColor", m_BackColor, m_def_BackColor
  559.       .WriteProperty "ShowFolderInfo", m_ShowFolderInfo, m_def_ShowFolderInfo
  560.       .WriteProperty "PicBoxBackColor", m_PicBoxBackColor, m_def_PicBoxBackColor
  561.       .WriteProperty "ProBarColor", m_ProBarColor, m_def_ProBarColor
  562.       .WriteProperty "RndCorners", m_RndCorners, m_def_RndCorners
  563.       .WriteProperty "PicDimen", m_PicDimen, m_def_PicDimen
  564.    End With
  565.  
  566. End Sub
  567.  
  568. Private Sub ClearAll()
  569.  
  570.   Dim x As Integer
  571.  
  572.    'reset display window and scrollbar to top
  573.    picDisplay.Top = 0
  574.    picDisplay.Height = 0
  575.    VS1.Value = 0
  576.    
  577.    'clear all thumbnails and labels
  578.    For x = 0 To List1.ListCount - 1
  579.       picThumbNail(x).Picture = LoadPicture
  580.       imgSizing.Picture = LoadPicture
  581.       picThumbNail(x).Visible = False
  582.       sFrame(x).Visible = False
  583.       lblThumb(x).Caption = ""
  584.       lblTDim(x).Caption = ""
  585.    Next x
  586.  
  587.    List1.Clear          'clear the files list
  588.    
  589. End Sub
  590.  
  591. Public Sub CreateThumbNail(PicBox As Object, _
  592.                            ByVal picImg As StdPicture, _
  593.                            ByVal MaxHeight As Long, _
  594.                            ByVal MaxWidth As Long, _
  595.                            Center As Boolean, _
  596.                            Optional ByVal PicTop As Integer, _
  597.                            Optional ByVal PicLeft As Integer)
  598.  
  599.   Dim NewH As Long                                                            'New Height
  600.   Dim NewW As Long                                                           'New Width
  601.  
  602.  
  603.       NewH = picImg.Height                                                   'actual image height
  604.       NewW = picImg.Width                                                   'actual image width
  605.  
  606.    If NewH > MaxHeight Or NewW > MaxWidth Then            'picture is too large
  607.       If NewH > NewW Then                                                   'height is greater than width
  608.          NewW = Fix((NewW / NewH) * MaxHeight)                 'rescale height
  609.          NewH = MaxHeight                                                      'set max height
  610.        ElseIf NewW > NewH Then                                            'width is greater than height
  611.          NewH = Fix((NewH / NewW) * MaxWidth)                   'rescale width
  612.          NewW = MaxWidth                                                      'set max Width
  613.          Debug.Print "Width>"
  614.        Else                                                                                'image is square
  615.          NewH = MaxHeight
  616.          NewW = MaxWidth
  617.       End If
  618.  
  619.    End If
  620.  
  621.    'check if centered
  622.    If Center = True Then                                                         'center picture
  623.       PicTop = (PicBox.Height / 2) - (NewH / 2) - 10
  624.       PicLeft = (PicBox.Width / 2) - (NewW / 2) - 10
  625.     Else                                                                                    'if Optional variables are
  626.                                                                                               'missing  and center=false
  627.       PicTop = 0                                                                        'Default top position
  628.       PicLeft = 0                                                                        'Default left position
  629.    End If
  630.  
  631.    If prev = True Then
  632.       picPreview.Width = NewW
  633.       picPreview.Height = NewH
  634.       prev = False
  635.    End If
  636.  
  637.    'Draw newly scaled picture
  638.    With PicBox
  639.       .AutoRedraw = True                                                            'set needed properties
  640.       .Cls                                                                                      'clear picture box
  641.       .PaintPicture picImg, PicLeft, PicTop, NewW, NewH             'paint new picture size in                                                                    '   picturebox
  642.    End With
  643.  
  644. End Sub
  645.  
  646. Public Sub FormDrag(TheForm As Object)
  647.  
  648.    On Local Error Resume Next
  649.    ReleaseCapture
  650.    SendMessage TheForm.HWND, &HA1, 2, 0&
  651.  
  652. End Sub
  653.  
  654. Private Sub lblThumb_Click(Index As Integer)
  655.  
  656.    m_SelectedFile = List1.List(Index)
  657.    m_SelectedFolder = tmpPath
  658.    m_FullPath = tmpPath & List1.List(Index)
  659.    lblFileSize.Caption = FormatNumber(FileLen(m_FullPath) / 1024, 0) & "KB"
  660.    RaiseEvent Click
  661.    RaiseEvent DblClick
  662.  
  663. End Sub
  664.  
  665. Private Sub LoadList()
  666.  
  667.   Dim sTemp As String
  668.  
  669.    If Right$(FolderPath, 1) = "\" Then                             'determine weather theres a "\"
  670.                                                                                       'at the end of the path
  671.       tmpPath = FolderPath
  672.     Else
  673.       tmpPath = FolderPath & "\"
  674.    End If
  675.  
  676.    'load the filenames into the list
  677.    sTemp = Dir$(tmpPath & "*.*")
  678.  
  679.    While sTemp <> ""
  680.       List1.AddItem sTemp
  681.       sTemp = Dir$
  682.    Wend
  683.  
  684.    lblFileCount.Caption = List1.ListCount                         'show number of files
  685.    lblCurFold.Caption = FolderPath
  686.    lblFolderSz.Caption = FormatNumber(GetPathSize(FolderPath) / 1024, 0) & "KB"
  687.    Image1.Visible = False                                               'just in case it was still visible
  688. End Sub
  689.  
  690. Private Sub LoadPics()
  691.  
  692.   Dim x As Integer
  693.   Dim Y As Integer
  694.   Dim token As Long
  695.   Dim pgct As Single
  696.   
  697.    On Error Resume Next
  698.    picPreview.Visible = False
  699.    picDisplay.Visible = False
  700.    lblSorry.Visible = False
  701.    lblLoading.Visible = True                                   'Loading...Please Wait
  702.    DoEvents
  703.  
  704.    VS1.Enabled = False                                         'disable scrollbar while loading
  705.    
  706.    'calculate height of display window
  707.    pgct = List1.ListCount / 16                              '16 is the number of images displayed per page
  708.    If pgct <= 1 Then
  709.       picDisplay.Height = picMain.Height
  710.       VS1.Max = 0
  711.    Else
  712.       picDisplay.Height = (pgct * (picMain.Height * 1.1))
  713.       VS1.Max = picDisplay.Height / picMain.Height * 2
  714.    End If
  715.    
  716.    VS1_Change
  717.    
  718.    For x = 0 To List1.ListCount - 1
  719.       'dynamically load all controls
  720.       Load picThumbNail(x)
  721.       Load lblThumb(x)
  722.       Load lblTDim(x)
  723.       Load sFrame(x)
  724.  
  725.       If RndCorners = True Then
  726.          SmoothForm picThumbNail(x), 15
  727.          sFrame(x).Shape = 4
  728.        Else
  729.          sFrame(x).Shape = 0
  730.       End If
  731.  
  732.       picThumbNail(x).BackColor = PicBoxBackColor
  733.  
  734.       With picThumbNail(x)
  735.          .Left = picThumbNail(x - 1).Left + picThumbNail(x - 1).Width + 245
  736.          .Top = picThumbNail(x - 1).Top
  737.          .Visible = True
  738.          .Picture = LoadPicture()
  739.       End With
  740.  
  741.       With lblThumb(x)
  742.          .Left = picThumbNail(x).Left - 100
  743.          .Top = picThumbNail(x).Top + picThumbNail(x).Height + 20
  744.          .ForeColor = FontColor
  745.          .Caption = ShortName(List1.List(x))
  746.          .Visible = True
  747.       End With
  748.       
  749.       With lblTDim(x)
  750.          .Left = picThumbNail(x).Left - 100
  751.          .Top = lblThumb(x).Top + lblThumb(x).Height - 40
  752.          .ForeColor = FontColor
  753.          .Caption = ""
  754.          .Visible = True
  755.       End With
  756.       With sFrame(x)
  757.          .Left = picThumbNail(x).Left - 30
  758.          .Top = picThumbNail(x).Top - 30
  759.          .BorderColor = PicBoxBorderColor
  760.          .Visible = True
  761.       End With
  762.  
  763.       If Y = 4 Then                                                 'allow 4 thumbnails per row
  764.          Y = 0
  765.          'position the first picture and label in new row
  766.  
  767.          With picThumbNail(x)
  768.             .Left = picThumbNail(0).Left
  769.             .Top = picThumbNail(x - 1).Top + lblThumb(x - 1).Height + picThumbNail(x - 1).Height + _
  770.                300
  771.          End With
  772.  
  773.          With lblThumb(x)
  774.             .Left = picThumbNail(x).Left - 100
  775.             .Top = picThumbNail(x).Top + picThumbNail(x).Height + 20
  776.          End With
  777.          
  778.          With lblTDim(x)
  779.             .Left = lblThumb(x).Left
  780.             .Top = lblThumb(x).Top + lblThumb(x).Height - 40
  781.          End With
  782.          
  783.          With sFrame(x)
  784.             .Left = picThumbNail(x).Left - 30
  785.             .Top = picThumbNail(x).Top - 30
  786.          End With
  787.  
  788.       End If
  789.  
  790.       Y = Y + 1                                                                  'advance the row counter by one
  791.                                                                        
  792.       'for checking extension
  793.       stg = LCase(Right$(List1.List(x), 4))                       'change any upper case extensions to lower case
  794.       
  795.       If stg = ".bmp" Or stg = ".jpg" Or stg = "jpeg" Or stg = ".ico" Or stg = ".gif" Or stg = ".wmf" Or stg = _
  796.          ".avi" Or stg = ".png" Then                                  'excepted formats ... process
  797.          
  798.          If stg = ".png" = True Then
  799.             token = InitGDIPlus
  800.             imgSizing.Picture = LoadPictureGDIPlus(FolderPath & "\" & List1.List(x), , , vbWhite)
  801.             CreateThumbNail picThumbNail(x), imgSizing.Picture, picThumbNail(x).Width, picThumbNail(x).Height, True
  802.             FreeGDIPlus token
  803.                If PicDimen = True Then                                   'get picture dimensions
  804.                   lblTDim(x).Caption = pngwidth & " X " & pngheight
  805.                End If
  806.          Else
  807.             imgSizing.Picture = LoadPicture(FolderPath & "\" & List1.List(x))
  808.             CreateThumbNail picThumbNail(x), imgSizing.Picture, picThumbNail(x).Width, picThumbNail(x).Height, True
  809.                If PicDimen = True Then                                      'get picture dimensions
  810.                    lblTDim(x).Caption = imgSizing.Width / Screen.TwipsPerPixelX & " X " & imgSizing.Height / Screen.TwipsPerPixelY
  811.                End If
  812.          End If
  813.          
  814.       Else
  815.          'process non-accepted extensions
  816.          picThumbNail(x).ForeColor = FontColor
  817.          picThumbNail(x).CurrentX = 200
  818.          picThumbNail(x).CurrentY = 400
  819.          picThumbNail(x).Print "Format Not"
  820.          picThumbNail(x).CurrentX = 200
  821.          picThumbNail(x).CurrentY = 600
  822.          picThumbNail(x).Print "Supported"
  823.       End If
  824.  
  825.       'calculate the length of progress bar
  826.       mvalue = mvalue + 1
  827.       sPrBar.Width = ((picPR.Width / List1.ListCount) * mvalue) + 500
  828.       
  829.    Next x
  830.    picDisplay.Visible = True
  831.    
  832.    'if no pics in folder , show label
  833.    If List1.ListCount = 0 Then
  834.       lblSorry.Visible = True
  835.     Else
  836.       lblSorry.Visible = False
  837.    End If
  838.  
  839.    lblLoading.Visible = False
  840.    picDisplay.Top = -10
  841.    If picDisplay.Visible = True Then VS1.Enabled = True
  842.  
  843.    'reset progress bar to zero
  844.    sPrBar.Width = 0
  845.    mvalue = 0
  846.  
  847. End Sub
  848.  
  849. Private Sub picPreview_DblClick()
  850.    picPreview.Visible = False
  851.    lblFileSize.Caption = ""
  852. End Sub
  853.  
  854. Private Sub picPreview_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
  855.    FormDrag picPreview
  856. End Sub
  857.  
  858. Private Sub picThumbNail_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)
  859. Dim token As Long
  860.  
  861.    'show preview picture
  862.    If Button = 1 Then
  863.       stg = LCase(Right$(List1.List(Index), 4))
  864.       m_SelectedFile = List1.List(Index)
  865.       m_SelectedFolder = tmpPath
  866.       m_FullPath = tmpPath & List1.List(Index)
  867.       lblFileSize.Caption = FormatNumber(FileLen(m_FullPath) / 1024, 0) & "KB"
  868.     
  869.       If stg <> ".png" Then
  870.           imgPreSize.Picture = LoadPicture(tmpPath & List1.List(Index))
  871.           prev = True
  872.           picPreview.Visible = True
  873.           CreateThumbNail picPreview, imgPreSize.Picture, 5000, 5000, False
  874.        Else
  875.           token = InitGDIPlus
  876.           
  877.           prev = True
  878.           picPreview.Visible = True
  879.              If (FileLen(tmpPath & List1.List(Index)) / 1024) > 3 Then
  880.                 Image1.Visible = False
  881.                 picPreview.Width = 5550
  882.                 picPreview.Height = 3630
  883.                 picPreview.Picture = LoadPictureGDIPlus(tmpPath & List1.List(Index), picPreview.Width / Screen.TwipsPerPixelX, picPreview.Height / Screen.TwipsPerPixelY, vbWhite, True)
  884.              Else
  885.                 picPreview.Width = 3000
  886.                 picPreview.Height = 3000
  887.                 picPreview.Picture = LoadPicture()
  888.                 Image1.Visible = True                                       'I'm using image1 to center small png's in preview window
  889.                 Image1.Picture = LoadPictureGDIPlus(tmpPath & List1.List(Index), picPreview.Width / Screen.TwipsPerPixelX / 4, picPreview.Height / Screen.TwipsPerPixelY / 4, vbWhite, True)
  890.              End If
  891.        FreeGDIPlus token
  892.        End If
  893.    End If
  894.  
  895.    RaiseEvent Click
  896.    RaiseEvent DblClick
  897.  
  898. End Sub
  899.  
  900. Private Sub SmoothForm(Frm As PictureBox, Optional ByVal Curvature As Double = 25)
  901.  
  902.   Dim hRgn As Long
  903.   Dim X1 As Long
  904.   Dim Y1 As Long
  905.  
  906.    X1 = Frm.Width / Screen.TwipsPerPixelX
  907.    Y1 = Frm.Height / Screen.TwipsPerPixelY
  908.    hRgn = CreateRoundRectRgn(0, 0, X1, Y1, Curvature, Curvature)
  909.    SetWindowRgn Frm.HWND, hRgn, True
  910.    DeleteObject hRgn
  911.  
  912. End Sub
  913.  
  914. Private Sub VS1_Change()
  915.    
  916.    If picDisplay.Height < picMain.Height Then picDisplay.Height = picMain.Height
  917.    picDisplay.Top = picMain.Top - ((picDisplay.Height / (VS1.Max + 3) * VS1.Value))
  918.    picDisplay.SetFocus                                   'keeps bar from flashing all the time
  919.  
  920. End Sub
  921.  
  922. Private Sub VS1_Scroll()
  923.    VS1_Change
  924. End Sub
  925.  
  926. Public Function GetPathSize(ByRef sPathName As String) As Double
  927.  
  928.   Dim sFileName As String
  929.   Dim dSize As Double
  930.   Dim asFileName() As String
  931.   Dim i As Long
  932.  
  933.    On Error Resume Next
  934.    ' Enumerate DirNames and FileNames
  935.    If StrComp(Right$(sPathName, 1), "\", vbBinaryCompare) <> 0 Then sPathName = sPathName & "\"
  936.    sFileName = Dir$(sPathName, vbDirectory + vbHidden + vbSystem + vbReadOnly)
  937.  
  938.    Do While Len(sFileName) > 0
  939.  
  940.       If StrComp(sFileName, ".", vbBinaryCompare) <> 0 And StrComp(sFileName, "..", _
  941.          vbBinaryCompare) <> 0 Then
  942.          ReDim Preserve asFileName(i)
  943.          asFileName(i) = sPathName & sFileName
  944.          i = i + 1
  945.       End If
  946.  
  947.       sFileName = Dir
  948.    Loop
  949.  
  950.    If i > 0 Then
  951.  
  952.       For i = 0 To UBound(asFileName)
  953.  
  954.          If (GetAttr(asFileName(i)) And vbDirectory) = vbDirectory Then
  955.             ' Add dir size
  956.             dSize = dSize + GetPathSize(asFileName(i))
  957.           Else
  958.             ' Add file size
  959.             dSize = dSize + FileLen(asFileName(i))
  960.          End If
  961.  
  962.       Next
  963.    End If
  964.  
  965.    GetPathSize = dSize
  966.  
  967. End Function
  968.  
  969. Private Function ShortName(sName As String)
  970.  
  971.   Dim LName As String
  972.   Dim fName As String
  973.   Dim RName As String
  974.  
  975.    If Len(sName) >= 14 Then                                        'this seems to be a good
  976.                                                                                     'compromise on name length
  977.       LName = Left$(sName, 7)
  978.       fName = "---"
  979.       RName = Right$(sName, 4)
  980.       ShortName = LName & fName & RName
  981.     Else
  982.       ShortName = sName
  983.    End If
  984.  
  985. End Function
  986.  
  987. Public Property Get BackColor() As OLE_COLOR
  988.    BackColor = m_BackColor
  989. End Property
  990.  
  991. Public Property Let BackColor(ByVal NewBackColor As OLE_COLOR)
  992.    m_BackColor = NewBackColor
  993.    picDisplay.BackColor = m_BackColor
  994.    picMain.BackColor = m_BackColor
  995.    UserControl.BackColor = m_BackColor
  996.    PropertyChanged "BackColor"
  997. End Property
  998.  
  999. Public Property Let FolderPath(ByVal NewFolderPath As String)
  1000.    m_FolderPath = NewFolderPath
  1001.    If NewFolderPath = "" Then Exit Property
  1002.    Visible    m_FolderPing)
  1003.  t$(sName,  m_FolderPath As Single, Y As Single)
  1004. Dim token As Long
  1005. De,  m_F1f1_Scroll())oll()ong
  1006. 'Pringlht$(sName, 
  1007. De,  m_F1o=h(ByVal NewFolderPath            eighte,  m_F1o=h(Byd" hen rPing)
  1008.  t$(sNamreen.TwiMain.Heiy    n.Tw t$(en l NewFolderPath            eieName
  1009.     )moleNamPath = "" Then Exit Propes to lo" The" (ByVormDrag picPreview
  1010. End Sub
  1011.  
  1012. Priv     =t    Charsep  0  'Transpareiv     =t lo" The" (BThen        cMain.HeightsAs OLE_COa TabInde'pBits Aeiv   c + 10
  1013. =E_COation SendMeblLoading.Visible ileName =screen.TweLen(asFong
  1014. Private Declare FunctioneThumbNail lLoadDimen =PBackColt Name(sName As String)MFRect1bLE_COLOR
  1015. Ping)MFRect1bLf i > 0 TR l User Control
  1016. '* lderPing)
  1017.  t$
  1018.          'New Width
  1019.  
  1020.  
  1021.       NewH = picImging.Visible ileName =screen.TweLen(asFong
  1022. PrivMFRecteNamPath = "" Teen.TweLdMFRecteNamPath = ""Get BackCi ile  m_FullPath == Single)
  1023. Dim ectct1bLf i > 0FullPat9ileNuYFFullPath == Singntrol
  1024. '* lde mvalue = mval" ""Get BackCi ) If
  1025.  
  1026.   1,useDownteNamPath =d If
  1027.  
  1028.    OLOR
  1029.    BackColor = m_BackColor
  1030. End Property
  1031.  
  1032. Public Property Let BackConroperty
  1033.  
  1034. Public Property) Screen.TwipsPerPi------- 4d
  1035.    picOR
  1036. -mbNail(xLOR
  1037.    tD, = "" Teen.6     =   2130
  1038.       TabIndkColorerPath
  1039.    If NewFolderPath = "" Then Val croperderPath X   D9 g
  1040.   lorerPatmxb  lorerPP3 Thenii------- 4d
  1041.    picOR
  1042. -t Name(sNlderPatl bRedraw As Teen.6     'ca
  1043.    pirPath X   D9 "gdiptl bRedr6     'ca
  1044.    prty Letare Functione_BackC" & List1ssontroVisible  een.6     'ca
  1045.    pirPaPrivate Sub InitDy   TabIring)
  1046.    m_Fo(sName, ouseDown(Button As Integer, Sh   End If
  1047.  
  1048.                ' Ad ileName =screen.TweLen(asFAs ng, ByValsPbme =screen.TweLen(asFAs ngkConroperty
  1049.  
  1050. Public Property) Scree size 1,useDownteNamPath =d If
  1051.  
  1052.    OLOR
  1053.    BackColor = m_BackColor
  1054. End PropertyTabIrinRSate Suzing.Width / Screen.TwipsPerPixelX & " X " &  SuzScreen.Tw  
  1055.    e, ouseDow-icThumbNail(x).CurrentXndkCoAs Long) Asng) Aso    Bight, True
  1056.  il(x).C (en l eDC t) Tw  
  1057. vendMeblLoadinglectObject Lib "g(ht * 2
  1058.    Endy  .6     pvDWORD) dest =inglectObject Liisplay.Height =  t) TfeDC splay.Height =  en.TweLen(as, ByVdef_Font ueight e
  1059.  
  1060.  P0000005&
  1061.     ListCountckColor
  1062. End s    Lis
  1063.           picPreview.Visible = True
  1064.  t ueight e
  1065.  
  1066.  P0B=inglectObnption =   een.6    Ci te * 2
  1067.    Endy  .6     pvDWORD) dest  file.Visible = Trueze 1,ueDC t)lorerPP3 ,ueDC   ebDC t)lor00005&
  1068.  ueDC   00005&
  1069. o ain.Hei"r
  1070.  ueDC   00005&
  1071. o ain.Hei"r
  1072.  ueDC         = t)lorerPP3 ,u alse
  1073.    picDrPP3 ,u alse
  1074.   edFolderAs Long)    i     t        - ITMAP = o 'show preview picturecThukting)
  1075.  t  2  'C
  1076.    
  1077.    
  1078.    
  1079.    
  1080.    
  1081.    
  1082.    
  1083.    
  1084.     00005&      lblSorromiame
  1085.     Else
  1086.       Sholor As O As uWORD) deen.6p Lib "gdiplu recThukting)
  1087.  t  2  'C
  1088.    
  1089.    
  1090. tConst m_def_ng)
  1091.  
  1092.    t)lor0000 
  1093.    
  1094.    
  1095.     0 As n =   eeLib "gdip 1bLf ShowFoldere
  1096. PrBag
  1097.       Pareiv     =t lo    eRDC t)lor00  Else
  1098.           token = InitGDIP eeLib "gdiBn = InitGDIP eeLib "gd         NeClse
  1099.     bIndkColorerPath
  1100.       'rpPath & Lis      'ien'eeLib "gd   eeL       token = InitGDIP eeLo1
  1101.    dkCoAs t)lorerPP3 ,u oingle)
  1102. Dim token Asa   'ien' "gdip 1bLf)     ElPs      'ien'eeLd    1bLf ShowFoldere
  1103. n' "gdip per row
  1104.    or
  1105. End s    e, Y As Sin-p per  t)lorerPP3 ,u oinglePgle)
  1106. Dim token As Long
  1107.  
  1108.    'show previ<DIP e  Charsep  0 i)ightsAs OLDIP eDe,  m_F1o=h(ByVal NewFolderConst m_def_ng)
  1109.  
  1110.    t)lor0000 
  1111.    
  1112.    
  1113.     0 As n =   eeLib "gdip 1bLf  ElPs .Paint      ong
  1114. Priv ( sY(sName
  1115.              With sFram.(ght)lor0000 
  1116. olderConst m_def_ng)
  1117.  
  1118.    t)lor0000 
  1119.    
  1120.    
  1121.   00 
  1122.    
  1123.    
  1124. d s    e, sY(sNam
  1125.    Rev Rev Rev Rev Rew previ<DI NewFolderConst i<DI NewF             WitheDe,                  
  1126.     
  1127.  t  2  'C
  1128. =sCoAs Long) Asc_def_w,""
  1129.    (
  1130.    (
  1131.      bWhite,vate Declare Function Ch X   + 10
  1132. eDe,         (
  1133.      e)
  1134. Dim token As Long
  1135.  
  1136.  en.TweLe(1     ' BitmaAlse
  1137.          eNash=gle
  1138.       Foreash=gle
  1139.      Info", m_ShowFolitmaADim tokPCh X     &H8000002  'C( Sub FormDrag
  1140. .4 token As Longa1    As Long
  1141.    Data2    As Integer
  1142.    Data3    As IIIIIIIIIIIIIIIIIIIIIIm_Sh
  1143.   edFolderAPgle)
  1144. Dim token As L=rderColo
  1145. n' ertedFolderA)ElPs .Painpe rderCoF'* ldeicoick
  1146.  
  1147. Eefo    As IIIIIIIIIIIIIIIIIIIIIIm ertedFolderA)oaDisplay.Left =r      'get picture dimensionsPicture dimen mhte, True)
  1148.              End If
  1149.     ,ist   lParaAsc_def_w,""
  1150.             l
  1151. '* ldAs Longb derA)oaDisplay.Left =r      '           lo", IIIwFoldere
  1152. PrBag
  1153. on
  1154.             ' An As L=r    =   735= Frm.W P0B=inglectObDPf
  1155.  rCoF'* ons L=r    =   73
  1156.  rCoF'* ons L=  End Witt =r   0    i   ,PropertyTa ature=4rty Get SelectedFile
  1157. '   Public Property
  1158.    'reset display windoset dispo e=4rty Get SelectedFileEndv) s  ature=o'Val nBitCounti4  ature=o'V3(   OLan height
  1159.          NewH = Fix((NewH / NewW) * MaxWidth)                   (t) TfGetImagevOLantObject LiioyCom IfGet Selean height
  1160.    fGetImagevOLantObbature=oPtmaAiGetImagevOLantObbat3wH = ic PropePalse
  1161.  0000e
  1162.  
  1163.  P00omiamelat3wH = ic PropePalse
  1164.  0000e
  1165.  
  1166.  P00omiamelat3'   P   As IIIIIIII
  1167. () As IIIIIIII
  1168. IIIm erteLong) Asng) AsngriteProperties  If SSSSSSSSSS-ure=oPtmaAiGetImaggm- rty("ShowFolde height      NeClse
  1169.     bIndkColorerPath
  1170.       'rpPatUe
  1171. '   Public Property
  1172.    'reShowFolde herrse
  1173. '   Public Proper
  1174. (c Proper
  1175. (c Proper
  1176. ill" (ByVal ImagehowFoies  If SS(Oss='actual image () As )   s   bIndkColorerPa   bInlII
  1177. IIIm erteLong) Asng) A***************************************************
  1178.  
  1179. '***************** Table ong
  1180. Priy
  1181.    'reSh"gdiBn = Initring
  1182. Private m_Selecte,= Init
  1183.    
  1184. tConst m_derivate m_,erespnit
  1185.    
  1186. tConf  ElPs .Paint      m_,erespe ong
  1187. Priy
  1188. s NewW)n
  1189. End s    et
  1190. PriyDeDown(ButtrerPath
  1191.  -Const m_derivateDderConst m_4-                                   'height)
  1192.  P00omiamelat3')Cons
  1193. s NewW)n
  1194. End s      CharButtreW)n
  1195. End s      CharButtreW)n
  1196. End s      CharBut,ring)t
  1197. PriyDeE
  1198.    'reSh"gdtion Resizeiivate De9SS(Oss='actual image () As )   s   bIn NewW)n
  1199. End s    et
  1200. PriyDeDowv   CharButeaseCa= t pict= Integer)
  1201.  
  1202.    m_Sel*******IntegerP ld                                             'missing  and center=false
  1203.       Pics(lean     ' 9SS(Oss='acttype
  1204. PrimlPs .Painpe rst1.Liolor"
  1205. vendMeblLoadinglectObject Lib "itialize(ng, ByVal nIndelse
  1206.   (Ossoreen.Tis seems  Metafile As Lon Thecs(lese
  1207.    0BLEKEY = &H9t    If stg = ".bgEY       ' IIIm erCa= t pict=r se
  1208.   (Ossoreen.Tis seems  Metafile As Lon Thecs(les       aOss='actuavm_FullPath) / aOss='actuavm_t m_derivateDderConst m_4-    aOss='actuavm_t m_Dim pRewFol late De9S lect   aOss='actuavm and censplay.ic PropePalse1 Then
  1209.     uavm andys''cens''Pareiv9uavm andys''ceR     Pic
  1210.       UserControl.Height = picMain._ShowFolderInfo, m_def_ShowFoldya,vateDderCon   a  arhowe Sub UserContr
  1211.       'avm andys''cedef_FontColor
  1212.      nsplaleNamPath =              A4( nspnd censslse
  1213.    0    i   ,P
  1214.       .WritePd censslse
  1215. eDe,    hmDeclare Fucensslse
  1216. edeensOv   hmD   End If
  1217. ion Resizess='actuavm_t m_Dim ppe1 trol.Height = picMain._ShowFolderInfo,maAi,c As InteaFunction'ading.Vis   Endy     hmD   End If
  1218. ion Resizess='actuavm_t m_Dim ppe1 tro     ,t m_Dim  ppe1avmamPath mt + VS1.Width + 10
  1219.       UserControl.HeigdeaFunaAiGetImagct   aOss='  aOsscedef_es   EndY0=Pic(      WmHeight =h
  1220.       End Ifh, 1) = "\" Then         (   eiF1) = "\" Then     monaAiGet,iml + lerInfo,maAi,c ge hei7*****************Y0=Pic( ControL
  1221. De,  m      'deter(eaFunction'ading.Vis   End
  1222.    For xerI(ndex)
  1223.  irectory + vbHidden + vbSystem + vbReadOn6voFalse
  1224.    picDisplay.V         Dim  ppe1avmamPath mt + VS1lse
  1225.       Enablading.+ lerInfo,maAiAectory + vbHidden + vbSys e1a   3     BackCidden + d      icDisplay.V             Else,    i     t      s*Y0=Picppe1avma vbHiddenroper
  1226. i-9vma vbHiddenr    = "" Teen.TweLe
  1227.       Enablading.HiddeReadOn6voFao   Enablais   VS1.V)sadOn6vo_Dim pRewFol laCoAs t)m_Dim ppttory + ma vbHid(sipicDispD_Chnabh
  1228.       End Ifh,  s   t=eems              End Ifh,_ShowFolderInfo As Boo, Sh   End If
  1229. BEnd IfhdeReaoo, Sh   End If
  1230. BEnd IfhdeReaoo, Sh   End I--'Ifh,  s   t=eems     Ifh,  s m IfhdeR()
  1231.       EndIIIIroper
  1232. i-9.cDi024, 0) & "KB"
  1233.    Image1.Visible = False                                               'just in case it was(         ,                   nablad        izesd If
  1234. BE                   'show L pngheight
  1235.              )moleNamPath = "" Then Exit d         Thug) Asumb(x).Height -picMa(x))
  1236.          .Visible = eig))
  1237.    entXndkCoAs izoxBorderColoible = e= e= e= e= e= e=2ndkCoAs izoxBor picMain._ShosposeIntX = 200
  1238.          picThumbNail(xnd If
  1239. BEnd IfbNail(xn Val c
  1240.    entXndkCse it w   
  1241.    
  1242.   00'4eR      nablad        oCro          End Ifh,nablad       tisycDisct Lib "g(ht ,blad d     d Sub
  1243.  
  1244. Private Sub Smoo)b "g(ht ,bXndkCoAs izox    r Smoo)b "g(ht ,a    pvDWO4te De9SWO4te De9SWO4te D   pvDW             blan Resizess=)b "g(  s m IRght = pe = eig))t + VS1.Wi y Let BackCon2IRght =  .Visi _
  1245.       ByVa ,bXnd,ctedFolder = tmpPath
  1246.  = Sub
  1247.  
  1248. Pi _
  1249.       ByrPP       blan Resn Resn 
  1250. Pi _
  1251.    m IRght = pvD
  1252.  
  1253. Privasmaoo, lPath) 2m Prese pvDixelX ssing  Sub
  1254.     e.TwiXeaoo, Sh   End I--'Ifh,   Ifh,  entXndkCoAs izoxBoi pvDxBackColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoColoCo