home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form Resize BorderStyle = 3 'Fixed Dialog Caption = "Resize" ClientHeight = 2835 ClientLeft = 1995 ClientTop = 2595 ClientWidth = 4605 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "Resize1.frx":0000 LinkTopic = "Form1" LockControls = -1 'True MaxButton = 0 'False MinButton = 0 'False PaletteMode = 1 'UseZOrder ScaleHeight = 2835 ScaleWidth = 4605 ShowInTaskbar = 0 'False Begin VB.CheckBox ResampleBox Caption = "&Resample" Height = 255 Left = 3255 TabIndex = 7 Top = 1890 Width = 1200 End Begin VB.CommandButton Cancel Cancel = -1 'True Caption = "Cancel" Height = 375 Left = 2595 TabIndex = 9 Top = 2295 Width = 1200 End Begin VB.CommandButton OK Caption = "OK" Default = -1 'True Height = 375 Left = 810 TabIndex = 8 Top = 2295 Width = 1200 End Begin VB.CheckBox AspectRatioBox Caption = "Maintain &Aspect-Ratio" Height = 255 Left = 195 TabIndex = 6 Top = 1890 Width = 2250 End Begin VB.Frame Frame2 Caption = "Height" Height = 750 Left = 195 TabIndex = 3 Top = 990 Width = 4200 Begin VB.HScrollBar Value2Bar Height = 240 LargeChange = 10 Left = 1035 TabIndex = 5 Top = 300 Width = 2985 End Begin VB.TextBox Value2Box Height = 285 Left = 195 TabIndex = 4 Text = "Height" Top = 270 Width = 720 End End Begin VB.Frame Frame1 Caption = "Width" Height = 750 Left = 195 TabIndex = 0 Top = 120 Width = 4200 Begin VB.TextBox Value1Box Height = 285 Left = 195 TabIndex = 1 Text = "Width" Top = 270 Width = 720 End Begin VB.HScrollBar Value1Bar Height = 240 LargeChange = 10 Left = 1035 TabIndex = 2 Top = 300 Width = 2985 End End Attribute VB_Name = "Resize" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Const CHECKED = 1 Const UNCHECKED = 0 Dim fInValue1Box As Boolean Dim fInValue2Box As Boolean Dim fInValue1Bar As Boolean Dim fInValue2Bar As Boolean Dim fUserGo As Boolean Dim UseType As Integer Public Sub InitTheForm(FormType%) Dim nTemp As Long fUserGo = False UseType = FormType Select Case FormType Case RESIZEREGION_TYPE Caption = "Resize" Frame1.Caption = "Width" Frame2.Caption = "Height" Value1Bar.Min = 1 Value2Bar.Min = 1 Value1Bar.Max = 16384 nTemp = CLng(16384) * Main.ActiveForm.Lead1.BitmapHeight / Main.ActiveForm.Lead1.BitmapWidth If nTemp > 32767 Then nTemp = 32767 End If Value2Bar.Max = CInt(nTemp) Value1Bar.LargeChange = 100 Value2Bar.LargeChange = 100 Value1Bar.SmallChange = 10 Value2Bar.SmallChange = 10 Value1Bar = Main.ActiveForm.Lead1.RgnWidth Value2Bar = Main.ActiveForm.Lead1.RgnHeight ResampleBox.Value = UNCHECKED AspectRatioBox.Value = CHECKED Case RESIZE_TYPE Caption = "Resize" Frame1.Caption = "Width" Frame2.Caption = "Height" Value1Bar.Min = 1 Value2Bar.Min = 1 Value1Bar.Max = 16384 nTemp = CLng(16384) * Main.ActiveForm.Lead1.BitmapHeight / Main.ActiveForm.Lead1.BitmapWidth If nTemp > 32767 Then nTemp = 32767 End If Value2Bar.Max = CInt(nTemp) Value1Bar.LargeChange = 100 Value2Bar.LargeChange = 100 Value1Bar.SmallChange = 10 Value2Bar.SmallChange = 10 Value1Bar = Main.ActiveForm.Lead1.BitmapWidth Value2Bar = Main.ActiveForm.Lead1.BitmapHeight ResampleBox.Value = UNCHECKED AspectRatioBox.Value = CHECKED Case DETECT_TYPE Caption = "Intensity Detect" ResampleBox.Visible = False AspectRatioBox.Visible = False Frame1.Caption = "Low" Frame2.Caption = "High" Value1Bar.Min = 0 Value2Bar.Min = 0 Value1Bar.Max = 255 Value2Bar.Max = 255 Value1Bar.LargeChange = 10 Value2Bar.LargeChange = 10 Value1Bar.SmallChange = 1 Value2Bar.SmallChange = 1 Value1Bar = 128 Value2Bar = 128 Case STAMP_TYPE Caption = "Stamp Dimensions" ResampleBox.Visible = True AspectRatioBox.Visible = True Frame1.Caption = "Width" Frame2.Caption = "Height" Value1Bar.Min = 1 Value2Bar.Min = 1 Value1Bar.Max = 125 Value2Bar.Max = 125 Value1Bar.LargeChange = 10 Value2Bar.LargeChange = 10 Value1Bar.SmallChange = 1 Value2Bar.SmallChange = 1 Value1Bar = 64 Value2Bar = 64 AspectRatioBox.Value = CHECKED ResampleBox.Value = UNCHECKED ResampleBox.Caption = "8-bit" End Select fInValue1Box = False fInValue2Box = False fInValue1Bar = False fInValue2Bar = False Left = (Screen.Width - Width) / 2 Top = (Screen.Height - Height) / 2 End Sub Public Sub GetResults(fOK As Boolean, nValue1%, nValue2%, fResample As Boolean) fOK = fUserGo nValue1 = Value1Bar nValue2 = Value2Bar If ResampleBox.Value = CHECKED Then fResample = True fResample = False End If End Sub Private Sub AspectRatioBox_Click() Dim nTemp As Long If (UseType = RESIZE_TYPE) Or (UseType = RESIZEREGION_TYPE) Then Value2Bar.Min = 1 If UseType = RESIZE_TYPE Then nTemp = CLng(16384) * Main.ActiveForm.Lead1.BitmapHeight / Main.ActiveForm.Lead1.BitmapWidth Else nTemp = CLng(16384) * Main.ActiveForm.Lead1.RgnHeight / Main.ActiveForm.Lead1.RgnWidth End If If nTemp > 32767 Then nTemp = 32767 End If Value2Bar.Max = CInt(nTemp) If UseType = RESIZE_TYPE Then nTemp = CLng(Value1Bar) * Main.ActiveForm.Lead1.BitmapHeight / Main.ActiveForm.Lead1.BitmapWidth Else nTemp = CLng(Value1Bar) * Main.ActiveForm.Lead1.RgnHeight / Main.ActiveForm.Lead1.RgnWidth End If If nTemp > 32767 Then nTemp = 32767 End If Value2Bar = CInt(nTemp) End If End Sub Private Sub Cancel_Click() End Sub Private Sub Form_Activate() Value1Box.SetFocus End Sub Private Sub OK_Click() If Len(Value1Box.Text) > 0 And Len(Value2Box.Text) > 0 Then If CInt(Value1Box.Text) <= Value1Bar.Max And CInt(Value1Box.Text) >= Value1Bar.Min And CInt(Value2Box.Text) <= Value2Bar.Max And CInt(Value2Box.Text) >= Value2Bar.Min Then fUserGo = True Hide End If End If End Sub Private Sub Value1Bar_Change() Dim NewValue2 As Integer Dim nTemp As Long If fInValue1Box = False Then fInValue1Bar = True Value1Box.Text = CStr(Value1Bar.Value) If AspectRatioBox.Value = CHECKED Then If UseType = RESIZEREGION_TYPE Then nTemp = CLng(Value1Bar) * Main.ActiveForm.Lead1.RgnHeight / Main.ActiveForm.Lead1.RgnWidth Else nTemp = CLng(Value1Bar) * Main.ActiveForm.Lead1.BitmapHeight / Main.ActiveForm.Lead1.BitmapWidth End If If nTemp > 32767 Then nTemp = 32767 End If NewValue2 = CInt(nTemp) If NewValue2 <> Value2Bar And NewValue2 >= Value2Bar.Min And NewValue2 <= Value2Bar.Max Then Value2Bar = NewValue2 End If End If End If fInValue1Box = False End Sub Private Sub Value1Box_Change() Dim NewValue2 As Integer If fInValue1Bar = False Then fInValue1Box = True If Len(Value1Box.Text) > 0 Then If CInt(Value1Box.Text) <= Value1Bar.Max And CInt(Value1Box.Text) >= Value1Bar.Min Then Value1Bar = CInt(Value1Box.Text) If AspectRatioBox.Value = CHECKED Then If UseType = RESIZEREGION_TYPE Then NewValue2 = CInt(CLng(Value1Bar) * Main.ActiveForm.Lead1.RgnHeight / Main.ActiveForm.Lead1.RgnWidth) Else NewValue2 = CInt(CLng(Value1Bar) * Main.ActiveForm.Lead1.BitmapHeight / Main.ActiveForm.Lead1.BitmapWidth) End If If NewValue2 <> Value2Bar And NewValue2 >= Value2Bar.Min And NewValue2 <= Value2Bar.Max Then Value2Bar = NewValue2 End If End If End If End If End If fInValue1Bar = False End Sub Private Sub Value2Bar_Change() Dim NewValue1 As Integer Dim nTemp As Long If fInValue2Box = False Then fInValue2Bar = True Value2Box.Text = CStr(Value2Bar.Value) If AspectRatioBox.Value = CHECKED Then If UseType = RESIZEREGION_TYPE Then nTemp = CLng(Value2Bar) * Main.ActiveForm.Lead1.RgnWidth / Main.ActiveForm.Lead1.RgnHeight Else nTemp = CLng(Value2Bar) * Main.ActiveForm.Lead1.BitmapWidth / Main.ActiveForm.Lead1.BitmapHeight End If If nTemp > 32767 Then nTemp = 32767 End If NewValue1 = CInt(nTemp) If NewValue1 <> Value1Bar And NewValue1 >= Value1Bar.Min And NewValue1 <= Value1Bar.Max Then Value1Bar = NewValue1 End If End If End If fInValue2Box = False End Sub Private Sub Value2Box_Change() Dim NewValue1 As Integer If fInValue2Bar = False Then fInValue2Box = True If Len(Value2Box.Text) > 0 Then If CInt(Value2Box.Text) <= Value2Bar.Max And CInt(Value2Box.Text) >= Value2Bar.Min Then Value2Bar = CInt(Value2Box.Text) If AspectRatioBox.Value = CHECKED Then If UseType = RESIZEREGION_TYPE Then NewValue1 = CInt(CLng(Value2Bar) * Main.ActiveForm.Lead1.RgnWidth / Main.ActiveForm.Lead1.RgnHeight) Else NewValue1 = CInt(CLng(Value2Bar) * Main.ActiveForm.Lead1.BitmapWidth / Main.ActiveForm.Lead1.BitmapHeight) End If If NewValue1 <> Value1Bar And NewValue1 >= Value1Bar.Min And NewValue1 <= Value1Bar.Max Then Value1Bar = NewValue1 End If End If End If End If End If fInValue2Bar = False End Sub