From 24860acaae4d5bdb03b2cf1579847b0a937afa71 Mon Sep 17 00:00:00 2001 From: Tanner Date: Thu, 10 Jan 2013 16:18:20 -0700 Subject: [PATCH] Epic interface overhaul step 2: previewing All effect tools with live previews have been redesigned in this commit. Instead of using plain picture boxes, effect previews now operate on a custom-built "fxPreview" control, which I have created specifically for PhotoDemon. This allows me to add new preview features - for example, toggling between the preview and the original image - and have the feature automatically available to every tool in the project. The presence of a single preview box (instead of a "before" and "after", as before), also provided a good opportunity to redesign all tool forms to a new, more modern layout. Tools are now horizontally distributed, with a large preview on the left, and tools options on the right. This is a better fit for widescreen monitors (and dual-monitor layouts), and it also means the program can *theoretically* be run at an 800x600 resolution. I don't actually care about this, but I thought it was a nice benefit. :) All effects and tools have been checked to make sure they can render the new preview size in real-time. All can, though some will be stuttery in the IDE. A number of other, smaller interface tweaks and bugfixes were added as part of this commit, but I don't plan on breaking them out separately. (These were discovered while testing all tools on the new preview system.) --- Classes/pdLayer.cls | 3 - Forms/VBP_FormBlackAndWhite.frm | 190 +++++------------ Forms/VBP_FormBlackLight.frm | 144 +++---------- Forms/VBP_FormBrightnessContrast.frm | 164 ++++----------- Forms/VBP_FormColorTemp.frm | 194 +++++------------ Forms/VBP_FormColorize.frm | 148 ++++--------- Forms/VBP_FormCustomFilter.frm | 298 ++++++++++----------------- Forms/VBP_FormDiffuse.frm | 170 ++++----------- Forms/VBP_FormEmbossEngrave.frm | 187 +++++------------ Forms/VBP_FormEqualize.frm | 138 ++++--------- Forms/VBP_FormEtchGlass.frm | 103 +++++---- Forms/VBP_FormFade.frm | 148 ++++--------- Forms/VBP_FormFindEdges.frm | 182 +++++----------- Forms/VBP_FormGamma.frm | 159 ++++---------- Forms/VBP_FormGrayscale.frm | 276 ++++++------------------- Forms/VBP_FormGrayscale.frx | Bin 338 -> 0 bytes Forms/VBP_FormHSL.frm | 196 ++++++------------ Forms/VBP_FormImageLevels.frm | 272 +++++++++--------------- Forms/VBP_FormInternetImport.frm | 14 +- Forms/VBP_FormInternetImport.frx | Bin 172 -> 169 bytes Forms/VBP_FormLens.frm | 103 +++++---- Forms/VBP_FormMaximum.frm | 158 ++++---------- Forms/VBP_FormMosaic.frm | 160 ++++---------- Forms/VBP_FormNoise.frm | 156 ++++---------- Forms/VBP_FormPinch.frm | 132 ++++++------ Forms/VBP_FormPosterize.frm | 146 +++---------- Forms/VBP_FormPrint.frm | 2 +- Forms/VBP_FormRechannel.frm | 190 +++++------------ Forms/VBP_FormReduceColors.frm | 200 +++++++----------- Forms/VBP_FormRipple.frm | 149 +++++++------- Forms/VBP_FormRotate.frm | 125 +++++------ Forms/VBP_FormSolarize.frm | 146 +++---------- Forms/VBP_FormSwirl.frm | 111 +++++----- Forms/VBP_FormTile.frm | 107 +++++----- Forms/VBP_FormTwins.frm | 146 ++++--------- Forms/VBP_FormWaves.frm | 149 +++++++------- Forms/VBP_FormWhiteBalance.frm | 147 +++---------- Modules/VBP_FastDrawing.bas | 56 +++-- Modules/VBP_FilterModule.bas | 2 +- PhotoDemon.vbp | 3 +- 40 files changed, 1711 insertions(+), 3663 deletions(-) delete mode 100644 Forms/VBP_FormGrayscale.frx diff --git a/Classes/pdLayer.cls b/Classes/pdLayer.cls index 6d8dd93a07..ae375915fa 100644 --- a/Classes/pdLayer.cls +++ b/Classes/pdLayer.cls @@ -1018,9 +1018,6 @@ Public Sub renderToPictureBox(ByRef dstPicture As PictureBox) 'Erase any existing picture dstPicture.Picture = LoadPicture("") - 'Set a default backcolor - dstPicture.backColor = RGB(127, 127, 127) 'vbButtonShadow - 'If the target picture box is smaller than this layer, request halftoning If (dstPicture.ScaleWidth < layerWidth) Or (dstPicture.ScaleHeight < layerHeight) Then SetStretchBltMode dstPicture.hDC, STRETCHBLT_HALFTONE diff --git a/Forms/VBP_FormBlackAndWhite.frm b/Forms/VBP_FormBlackAndWhite.frm index 64aab75f29..78959e227e 100644 --- a/Forms/VBP_FormBlackAndWhite.frm +++ b/Forms/VBP_FormBlackAndWhite.frm @@ -3,10 +3,10 @@ Begin VB.Form FormBlackAndWhite BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Black/White Color Conversion" - ClientHeight = 8820 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12150 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,27 +19,27 @@ Begin VB.Form FormBlackAndWhite LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 588 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 810 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 8190 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 8190 + Top = 5910 Width = 1365 End Begin VB.PictureBox picBWColor @@ -48,11 +48,11 @@ Begin VB.Form FormBlackAndWhite ForeColor = &H80000008& Height = 495 Index = 1 - Left = 3240 + Left = 9000 ScaleHeight = 465 ScaleWidth = 2745 - TabIndex = 15 - Top = 6240 + TabIndex = 11 + Top = 3360 Width = 2775 End Begin VB.PictureBox picBWColor @@ -61,11 +61,11 @@ Begin VB.Form FormBlackAndWhite ForeColor = &H80000008& Height = 495 Index = 0 - Left = 360 + Left = 6120 ScaleHeight = 465 ScaleWidth = 2745 - TabIndex = 14 - Top = 6240 + TabIndex = 10 + Top = 3360 Width = 2775 End Begin VB.ComboBox cboDither @@ -81,65 +81,19 @@ Begin VB.Form FormBlackAndWhite EndProperty ForeColor = &H00800000& Height = 330 - Left = 360 + Left = 6120 Style = 2 'Dropdown List TabIndex = 5 - Top = 5280 + Top = 2400 Width = 4935 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 8 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 7 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsThreshold Height = 255 - Left = 360 + Left = 6120 Max = 254 Min = 1 TabIndex = 2 - Top = 3840 + Top = 960 Value = 127 Width = 4935 End @@ -156,11 +110,11 @@ Begin VB.Form FormBlackAndWhite EndProperty ForeColor = &H00800000& Height = 315 - Left = 5400 + Left = 11160 MaxLength = 3 TabIndex = 3 Text = "127" - Top = 3810 + Top = 930 Width = 660 End Begin VB.CheckBox chkAutoThreshold @@ -178,17 +132,26 @@ Begin VB.Form FormBlackAndWhite EndProperty ForeColor = &H00404040& Height = 360 - Left = 360 + Left = 6120 TabIndex = 4 - Top = 4320 + Top = 1440 Width = 5655 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 13 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 16 - Top = 8040 - Width = 7095 + Left = 0 + TabIndex = 12 + Top = 5760 + Width = 12255 End Begin VB.Label Label1 AutoSize = -1 'True @@ -205,31 +168,11 @@ Begin VB.Form FormBlackAndWhite EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 13 - Top = 5880 + Left = 6000 + TabIndex = 9 + Top = 3000 Width = 3945 End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 12 - Top = 2880 - Width = 360 - End Begin VB.Label lblDither AutoSize = -1 'True BackStyle = 0 'Transparent @@ -245,9 +188,9 @@ Begin VB.Form FormBlackAndWhite EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 11 - Top = 4920 + Left = 6000 + TabIndex = 8 + Top = 2040 Width = 2130 End Begin VB.Label lblBWDisclaimer @@ -255,31 +198,11 @@ Begin VB.Form FormBlackAndWhite Caption = $"VBP_FormBlackAndWhite.frx":0000 ForeColor = &H00404040& Height = 735 - Left = 240 - TabIndex = 10 - Top = 7080 + Left = 6000 + TabIndex = 7 + Top = 4200 Width = 5775 End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 9 - Top = 2880 - Width = 480 - End Begin VB.Label lblHeader AutoSize = -1 'True BackStyle = 0 'Transparent @@ -295,9 +218,9 @@ Begin VB.Form FormBlackAndWhite EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 6 - Top = 3480 + Top = 600 Width = 1080 End End @@ -322,7 +245,7 @@ Option Explicit Private Sub cboDither_Click() If CBool(chkAutoThreshold.Value) Then txtThreshold.Text = calculateOptimalThreshold(cboDither.ListIndex) - masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, picEffect + masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, fxPreview End Sub 'When the auto threshold button is clicked, disable the scroll bar and text box and calculate the optimal value immediately @@ -337,7 +260,7 @@ Private Sub chkAutoThreshold_Click() txtThreshold.Enabled = True End If - masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, picEffect + masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, fxPreview End Sub @@ -380,16 +303,15 @@ Private Sub Form_Activate() cboDither.AddItem "Atkinson / Classic Macintosh", 11 cboDither.ListIndex = 11 DoEvents - - 'Draw the previews - DrawPreviewImage picPreview - masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me setHandCursor picBWColor(0) setHandCursor picBWColor(1) + 'Draw the preview + masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -398,13 +320,13 @@ End Sub Private Sub hsThreshold_Change() copyToTextBoxI txtThreshold, hsThreshold.Value - masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, picEffect + masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, fxPreview End Sub Private Sub hsThreshold_Scroll() chkAutoThreshold.Value = vbUnchecked copyToTextBoxI txtThreshold, hsThreshold.Value - masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, picEffect + masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, fxPreview End Sub 'Allow the user to select a custom color for each @@ -418,7 +340,7 @@ Private Sub picBWColor_Click(Index As Integer) If comDlg.VBChooseColor(newColor, True, True, False, Me.hWnd) Then picBWColor(Index).backColor = newColor - masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, picEffect + masterBlackWhiteConversion txtThreshold, cboDither.ListIndex, picBWColor(0).backColor, picBWColor(1).backColor, True, fxPreview End If End Sub @@ -502,7 +424,7 @@ Private Function calculateOptimalThreshold(ByVal DitherMethod As Long) As Long End Function 'Convert an image to black and white (1-bit image) -Public Sub masterBlackWhiteConversion(ByVal cThreshold As Long, Optional ByVal DitherMethod As Long = 0, Optional ByVal lowColor As Long = &H0, Optional ByVal highColor As Long = &HFFFFFF, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub masterBlackWhiteConversion(ByVal cThreshold As Long, Optional ByVal DitherMethod As Long = 0, Optional ByVal lowColor As Long = &H0, Optional ByVal highColor As Long = &HFFFFFF, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Converting image to two colors..." diff --git a/Forms/VBP_FormBlackLight.frm b/Forms/VBP_FormBlackLight.frm index 2b08e83877..e71c0305ca 100644 --- a/Forms/VBP_FormBlackLight.frm +++ b/Forms/VBP_FormBlackLight.frm @@ -3,10 +3,10 @@ Begin VB.Form FormBlackLight BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Black Light Options" - ClientHeight = 5325 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6285 + ClientWidth = 12030 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,82 +19,36 @@ Begin VB.Form FormBlackLight LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 355 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 419 + ScaleWidth = 802 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3330 + Left = 9030 TabIndex = 0 - Top = 4710 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4800 + Left = 10500 TabIndex = 1 - Top = 4710 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsIntensity Height = 255 - Left = 360 + Left = 6120 Max = 10 Min = 1 TabIndex = 2 - Top = 3840 + Top = 2760 Value = 2 Width = 4935 End @@ -111,59 +65,28 @@ Begin VB.Form FormBlackLight EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 2 TabIndex = 3 Text = "2" - Top = 3780 + Top = 2700 Width = 615 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 6 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -720 - TabIndex = 9 - Top = 4560 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 7 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 5 + Top = 5760 + Width = 12135 End Begin VB.Label Label1 AutoSize = -1 'True @@ -180,9 +103,9 @@ Begin VB.Form FormBlackLight EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 4 - Top = 3480 + Top = 2400 Width = 975 End End @@ -225,7 +148,7 @@ End Sub 'Perform a blacklight filter 'Input: strength of the filter (min 1, no real max - but above 7 it becomes increasingly blown-out) -Public Sub fxBlackLight(Optional ByVal Weight As Long = 2, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub fxBlackLight(Optional ByVal Weight As Long = 2, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Illuminating image with imaginary blacklight..." @@ -307,11 +230,8 @@ End Sub Private Sub Form_Activate() - 'Create a copy of the original image to the preview picture box - DrawPreviewImage picPreview - - 'Draw a preview of the effect on the neighboring picture box - fxBlackLight hsIntensity.Value, True, picEffect + 'Draw a preview of the effect + fxBlackLight hsIntensity.Value, True, fxPreview 'Assign the system hand cursor to all relevant objects makeFormPretty Me @@ -324,12 +244,12 @@ End Sub 'The next three routines keep the scroll bar and text box values in sync Private Sub hsIntensity_Change() - fxBlackLight hsIntensity.Value, True, picEffect + fxBlackLight hsIntensity.Value, True, fxPreview copyToTextBoxI txtIntensity, hsIntensity.Value End Sub Private Sub hsIntensity_Scroll() - fxBlackLight hsIntensity.Value, True, picEffect + fxBlackLight hsIntensity.Value, True, fxPreview copyToTextBoxI txtIntensity, hsIntensity.Value End Sub diff --git a/Forms/VBP_FormBrightnessContrast.frm b/Forms/VBP_FormBrightnessContrast.frm index 8fb7012f23..763310d3ad 100644 --- a/Forms/VBP_FormBrightnessContrast.frm +++ b/Forms/VBP_FormBrightnessContrast.frm @@ -3,10 +3,10 @@ Begin VB.Form FormBrightnessContrast BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Brightness/Contrast" - ClientHeight = 6780 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6270 + ClientWidth = 12075 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,91 +19,45 @@ Begin VB.Form FormBrightnessContrast LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 452 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 418 + ScaleWidth = 805 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 6150 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 10 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 9 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsContrast Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = -100 TabIndex = 4 - Top = 4680 + Top = 3000 Width = 4935 End Begin VB.HScrollBar hsBright Height = 255 - Left = 360 + Left = 6120 Max = 255 Min = -255 TabIndex = 2 - Top = 3840 + Top = 2160 Width = 4935 End Begin VB.TextBox txtContrast @@ -119,11 +73,11 @@ Begin VB.Form FormBrightnessContrast EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 3 TabIndex = 5 Text = "0" - Top = 4620 + Top = 2940 Width = 615 End Begin VB.TextBox txtBrightness @@ -139,11 +93,11 @@ Begin VB.Form FormBrightnessContrast EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 3 TabIndex = 3 Text = "0" - Top = 3780 + Top = 2100 Width = 615 End Begin VB.CheckBox chkSample @@ -161,58 +115,27 @@ Begin VB.Form FormBrightnessContrast EndProperty ForeColor = &H00404040& Height = 375 - Left = 360 + Left = 6120 TabIndex = 6 - Top = 5280 + Top = 3600 Value = 1 'Checked Width = 5655 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 10 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 13 - Top = 6000 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 12 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 11 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 9 + Top = 5760 + Width = 12135 End Begin VB.Label Label1 AutoSize = -1 'True @@ -229,9 +152,9 @@ Begin VB.Form FormBrightnessContrast EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 8 - Top = 4335 + Top = 2655 Width = 930 End Begin VB.Label LblBrightness @@ -249,9 +172,9 @@ Begin VB.Form FormBrightnessContrast EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 7 - Top = 3480 + Top = 1800 Width = 1185 End End @@ -283,7 +206,7 @@ Dim previewSampledContrast As Long 'Update the preview when the "sample contrast" checkbox value is changed Private Sub chkSample_Click() - If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, picEffect Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, picEffect + If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, fxPreview Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, fxPreview End Sub 'CANCEL button @@ -323,7 +246,7 @@ End Sub 'Single routine for modifying both brightness and contrast. Brightness is in the range (-255,255) while ' contrast is (-100,100). Optionally, the image can be sampled to obtain a true midpoint for the contrast function. -Public Sub BrightnessContrast(ByVal Bright As Long, ByVal Contrast As Single, Optional ByVal TrueContrast As Boolean = True, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub BrightnessContrast(ByVal Bright As Long, ByVal Contrast As Single, Optional ByVal TrueContrast As Boolean = True, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Adjusting image brightness..." @@ -495,15 +418,12 @@ Public Sub BrightnessContrast(ByVal Bright As Long, ByVal Contrast As Single, Op End Sub Private Sub Form_Activate() - - 'Initialize the preview windows - DrawPreviewImage picPreview previewHasSampled = 0 previewSampledContrast = 0 'Create the preview - BrightnessContrast hsBright.Value, hsContrast.Value, False, True, picEffect + BrightnessContrast hsBright.Value, hsContrast.Value, False, True, fxPreview 'Assign the system hand cursor to all relevant objects makeFormPretty Me @@ -518,22 +438,22 @@ End Sub ' other is modified by the user. When that happens, the preview window also gets updated. Private Sub hsBright_Change() copyToTextBoxI txtBrightness, hsBright.Value - If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, picEffect Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, picEffect + If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, fxPreview Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, fxPreview End Sub Private Sub hsBright_Scroll() copyToTextBoxI txtBrightness, hsBright.Value - If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, picEffect Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, picEffect + If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, fxPreview Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, fxPreview End Sub Private Sub hsContrast_Change() copyToTextBoxI txtContrast, hsContrast.Value - If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, picEffect Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, picEffect + If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, fxPreview Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, fxPreview End Sub Private Sub hsContrast_Scroll() copyToTextBoxI txtContrast, hsContrast.Value - If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, picEffect Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, picEffect + If chkSample.Value = vbChecked Then BrightnessContrast hsBright.Value, hsContrast.Value, True, True, fxPreview Else BrightnessContrast hsBright.Value, hsContrast.Value, False, True, fxPreview End Sub Private Sub txtBrightness_GotFocus() diff --git a/Forms/VBP_FormColorTemp.frm b/Forms/VBP_FormColorTemp.frm index eb977c5fe4..12bedc2326 100644 --- a/Forms/VBP_FormColorTemp.frm +++ b/Forms/VBP_FormColorTemp.frm @@ -3,10 +3,10 @@ Begin VB.Form FormColorTemp BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Adjust Color Temperature" - ClientHeight = 7020 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12330 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,36 +19,36 @@ Begin VB.Form FormColorTemp LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 468 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 822 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9360 TabIndex = 0 - Top = 6390 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10830 TabIndex = 1 - Top = 6390 + Top = 5910 Width = 1365 End Begin VB.HScrollBar hsStrength Height = 255 - Left = 240 + Left = 6120 Max = 100 Min = 1 - TabIndex = 11 - Top = 5400 + TabIndex = 7 + Top = 3600 Value = 55 Width = 5055 End @@ -65,11 +65,11 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11280 MaxLength = 3 - TabIndex = 10 + TabIndex = 6 Text = "50" - Top = 5355 + Top = 3555 Width = 735 End Begin VB.TextBox txtTemperature @@ -85,66 +85,20 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11280 MaxLength = 5 - TabIndex = 9 + TabIndex = 5 Text = "5500" - Top = 3675 + Top = 1875 Width = 735 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 4 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsTemperature Height = 255 - Left = 240 + Left = 6120 Max = 150 Min = 10 TabIndex = 2 - Top = 3720 + Top = 1920 Value = 55 Width = 5055 End @@ -163,20 +117,29 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H80000008& Height = 375 - Left = 480 + Left = 6360 ScaleHeight = 23 ScaleMode = 3 'Pixel ScaleWidth = 303 TabIndex = 3 - Top = 4080 + Top = 2280 Width = 4575 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 12 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 15 - Top = 6240 - Width = 7095 + Left = 0 + TabIndex = 11 + Top = 5760 + Width = 12375 End Begin VB.Label lblCool AutoSize = -1 'True @@ -193,9 +156,9 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H00404040& Height = 195 - Left = 4245 - TabIndex = 14 - Top = 4560 + Left = 10125 + TabIndex = 10 + Top = 2760 Width = 735 End Begin VB.Label lblWarm @@ -213,9 +176,9 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H00404040& Height = 195 - Left = 480 - TabIndex = 13 - Top = 4560 + Left = 6360 + TabIndex = 9 + Top = 2760 Width = 840 End Begin VB.Label lblStrength @@ -233,15 +196,15 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H00404040& Height = 285 - Left = 120 - TabIndex = 12 - Top = 5040 + Left = 6000 + TabIndex = 8 + Top = 3240 Width = 960 End Begin VB.Label lblTemperature AutoSize = -1 'True BackStyle = 0 'Transparent - Caption = "new temperature:" + Caption = "new temperature (K):" BeginProperty Font Name = "Tahoma" Size = 12 @@ -253,50 +216,10 @@ Begin VB.Form FormColorTemp EndProperty ForeColor = &H00404040& Height = 285 - Left = 120 - TabIndex = 8 - Top = 3360 - Width = 1890 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 7 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 6 - Top = 2880 - Width = 480 + Left = 6000 + TabIndex = 4 + Top = 1560 + Width = 2280 End End Attribute VB_Name = "FormColorTemp" @@ -362,7 +285,7 @@ End Sub 'Cast an image with a new temperature value ' Input: desired temperature, whether to preserve luminance or not, and a blend ratio between 1 and 100 -Public Sub ApplyTemperatureToImage(ByVal newTemperature As Long, Optional ByVal preserveLuminance As Boolean = True, Optional ByVal tempStrength As Single = 25, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub ApplyTemperatureToImage(ByVal newTemperature As Long, Optional ByVal preserveLuminance As Boolean = True, Optional ByVal tempStrength As Single = 25, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Applying new temperature to image..." @@ -472,16 +395,13 @@ Private Sub Form_Activate() Next x picTempDemo.Picture = picTempDemo.Image - - 'Create a copy of the image on the preview window - DrawPreviewImage picPreview - - 'Display the previewed effect in the neighboring window - ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Display the previewed effect in the neighboring window + ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -490,23 +410,23 @@ End Sub Private Sub hsStrength_Change() copyToTextBoxI txtStrength, hsStrength - ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, picEffect + ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, fxPreview End Sub Private Sub hsStrength_Scroll() copyToTextBoxI txtStrength, hsStrength - ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, picEffect + ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, fxPreview End Sub 'When the hue scroll bar is changed, redraw the preview Private Sub hsTemperature_Change() copyToTextBoxI txtTemperature, hsTemperature * 100 - ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, picEffect + ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, fxPreview End Sub Private Sub hsTemperature_Scroll() copyToTextBoxI txtTemperature, hsTemperature * 100 - ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, picEffect + ApplyTemperatureToImage CLng(hsTemperature.Value) * 100, True, CSng(hsStrength.Value) / 2, True, fxPreview End Sub 'Given a temperature (in Kelvin), generate the RGB equivalent of an ideal black body diff --git a/Forms/VBP_FormColorize.frm b/Forms/VBP_FormColorize.frm index 1c2cc362cd..1324755196 100644 --- a/Forms/VBP_FormColorize.frm +++ b/Forms/VBP_FormColorize.frm @@ -3,10 +3,10 @@ Begin VB.Form FormColorize BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Colorize Options" - ClientHeight = 6255 + ClientHeight = 6570 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12345 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,27 +19,27 @@ Begin VB.Form FormColorize LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 417 + ScaleHeight = 438 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 823 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9360 TabIndex = 0 - Top = 5595 + Top = 5925 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10830 TabIndex = 1 - Top = 5595 + Top = 5925 Width = 1365 End Begin VB.CheckBox chkSaturation @@ -57,65 +57,19 @@ Begin VB.Form FormColorize EndProperty ForeColor = &H00404040& Height = 435 - Left = 240 + Left = 6240 TabIndex = 3 - Top = 4680 + Top = 3240 Value = 1 'Checked Width = 4215 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsHue Height = 255 - Left = 240 + Left = 6240 Max = 359 Min = 1 TabIndex = 2 - Top = 3600 + Top = 2160 Value = 180 Width = 5775 End @@ -134,60 +88,49 @@ Begin VB.Form FormColorize EndProperty ForeColor = &H80000008& Height = 375 - Left = 480 + Left = 6480 ScaleHeight = 23 ScaleMode = 3 'Pixel ScaleWidth = 352 TabIndex = 4 - Top = 3960 + Top = 2520 Width = 5310 End - Begin VB.Label lblBackground - Height = 855 - Left = -840 - TabIndex = 9 - Top = 5400 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 6 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End - Begin VB.Label lblBefore + Begin VB.Label lblTitle AutoSize = -1 'True BackStyle = 0 'Transparent - Caption = "before" + Caption = "color to apply:" BeginProperty Font Name = "Tahoma" - Size = 8.25 + Size = 12 Charset = 0 Weight = 400 Underline = 0 'False - Italic = -1 'True + Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00404040& - Height = 195 - Left = 240 + Height = 285 + Left = 6000 TabIndex = 7 - Top = 2880 - Width = 480 + Top = 1680 + Width = 1545 + End + Begin VB.Label lblBackground + Height = 855 + Left = 0 + TabIndex = 5 + Top = 5760 + Width = 12375 End End Attribute VB_Name = "FormColorize" @@ -211,7 +154,7 @@ Option Explicit 'When the "maintain saturation" check box is clicked, redraw the image Private Sub chkSaturation_Click() - If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, picEffect Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, picEffect + If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, fxPreview Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, fxPreview End Sub 'CANCEL button @@ -234,7 +177,7 @@ End Sub 'Colorize an image using a hue defined between -1 and 5 ' Input: desired hue, whether to force saturation to 0.5 or maintain the existing value -Public Sub ColorizeImage(ByVal hToUse As Single, Optional ByVal maintainSaturation As Boolean = True, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub ColorizeImage(ByVal hToUse As Single, Optional ByVal maintainSaturation As Boolean = True, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Colorizing image..." @@ -332,15 +275,12 @@ Private Sub Form_Activate() picHueDemo.Picture = picHueDemo.Image - 'Create a copy of the image on the preview window - DrawPreviewImage picPreview - - 'Display the previewed effect in the neighboring window - If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, picEffect Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, picEffect - 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Display the previewed effect in the neighboring window + If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, fxPreview Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -349,9 +289,9 @@ End Sub 'When the hue scroll bar is changed, redraw the preview Private Sub hsHue_Change() - If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, picEffect Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, picEffect + If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, fxPreview Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, fxPreview End Sub Private Sub hsHue_Scroll() - If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, picEffect Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, picEffect + If chkSaturation.Value = vbChecked Then ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), True, True, fxPreview Else ColorizeImage CSng((CSng(hsHue.Value) - 60) / 60), False, True, fxPreview End Sub diff --git a/Forms/VBP_FormCustomFilter.frm b/Forms/VBP_FormCustomFilter.frm index 79b77304ab..93b7923e76 100644 --- a/Forms/VBP_FormCustomFilter.frm +++ b/Forms/VBP_FormCustomFilter.frm @@ -3,10 +3,10 @@ Begin VB.Form FormCustomFilter BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Custom Filter" - ClientHeight = 7620 + ClientHeight = 6540 ClientLeft = 150 ClientTop = 120 - ClientWidth = 6285 + ClientWidth = 10395 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,27 +19,27 @@ Begin VB.Form FormCustomFilter LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 508 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 419 + ScaleWidth = 693 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3300 + Left = 7380 TabIndex = 0 - Top = 6990 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4770 + Left = 8850 TabIndex = 1 - Top = 6990 + Top = 5910 Width = 1365 End Begin VB.TextBox txtBias @@ -55,60 +55,12 @@ Begin VB.Form FormCustomFilter EndProperty ForeColor = &H00800000& Height = 360 - Left = 4920 + Left = 8880 TabIndex = 28 Text = "1" - Top = 4560 + Top = 3720 Width = 735 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 32 - TabStop = 0 'False - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 31 - TabStop = 0 'False - Top = 120 - Width = 2895 - End Begin VB.TextBox TxtWeight Alignment = 2 'Center BeginProperty Font @@ -122,10 +74,10 @@ Begin VB.Form FormCustomFilter EndProperty ForeColor = &H00800000& Height = 360 - Left = 4920 + Left = 6960 TabIndex = 27 Text = "1" - Top = 4080 + Top = 3720 Width = 735 End Begin VB.TextBox TxtF @@ -142,10 +94,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 24 - Left = 2760 + Left = 8520 TabIndex = 26 Text = "0" - Top = 6000 + Top = 2640 Width = 540 End Begin VB.TextBox TxtF @@ -162,10 +114,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 23 - Left = 2160 + Left = 7920 TabIndex = 25 Text = "0" - Top = 6000 + Top = 2640 Width = 540 End Begin VB.TextBox TxtF @@ -182,10 +134,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 22 - Left = 1560 + Left = 7320 TabIndex = 24 Text = "0" - Top = 6000 + Top = 2640 Width = 540 End Begin VB.TextBox TxtF @@ -202,10 +154,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 21 - Left = 960 + Left = 6720 TabIndex = 23 Text = "0" - Top = 6000 + Top = 2640 Width = 540 End Begin VB.TextBox TxtF @@ -222,10 +174,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 20 - Left = 360 + Left = 6120 TabIndex = 22 Text = "0" - Top = 6000 + Top = 2640 Width = 540 End Begin VB.TextBox TxtF @@ -242,10 +194,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 19 - Left = 2760 + Left = 8520 TabIndex = 21 Text = "0" - Top = 5520 + Top = 2160 Width = 540 End Begin VB.TextBox TxtF @@ -262,10 +214,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 18 - Left = 2160 + Left = 7920 TabIndex = 20 Text = "0" - Top = 5520 + Top = 2160 Width = 540 End Begin VB.TextBox TxtF @@ -282,10 +234,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 17 - Left = 1560 + Left = 7320 TabIndex = 19 Text = "0" - Top = 5520 + Top = 2160 Width = 540 End Begin VB.TextBox TxtF @@ -302,10 +254,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 16 - Left = 960 + Left = 6720 TabIndex = 18 Text = "0" - Top = 5520 + Top = 2160 Width = 540 End Begin VB.TextBox TxtF @@ -322,10 +274,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00400000& Height = 360 Index = 15 - Left = 360 + Left = 6120 TabIndex = 17 Text = "0" - Top = 5520 + Top = 2160 Width = 540 End Begin VB.TextBox TxtF @@ -342,10 +294,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 14 - Left = 2760 + Left = 8520 TabIndex = 16 Text = "0" - Top = 5040 + Top = 1680 Width = 540 End Begin VB.TextBox TxtF @@ -362,10 +314,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 13 - Left = 2160 + Left = 7920 TabIndex = 15 Text = "0" - Top = 5040 + Top = 1680 Width = 540 End Begin VB.TextBox TxtF @@ -382,10 +334,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 12 - Left = 1560 + Left = 7320 TabIndex = 14 Text = "1" - Top = 5040 + Top = 1680 Width = 540 End Begin VB.TextBox TxtF @@ -402,10 +354,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 11 - Left = 960 + Left = 6720 TabIndex = 13 Text = "0" - Top = 5040 + Top = 1680 Width = 540 End Begin VB.TextBox TxtF @@ -422,10 +374,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00400000& Height = 360 Index = 10 - Left = 360 + Left = 6120 TabIndex = 12 Text = "0" - Top = 5040 + Top = 1680 Width = 540 End Begin VB.TextBox TxtF @@ -442,10 +394,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 9 - Left = 2760 + Left = 8520 TabIndex = 11 Text = "0" - Top = 4560 + Top = 1200 Width = 540 End Begin VB.TextBox TxtF @@ -462,10 +414,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 8 - Left = 2160 + Left = 7920 TabIndex = 10 Text = "0" - Top = 4560 + Top = 1200 Width = 540 End Begin VB.TextBox TxtF @@ -482,10 +434,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 7 - Left = 1560 + Left = 7320 TabIndex = 9 Text = "0" - Top = 4560 + Top = 1200 Width = 540 End Begin VB.TextBox TxtF @@ -502,10 +454,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 6 - Left = 960 + Left = 6720 TabIndex = 8 Text = "0" - Top = 4560 + Top = 1200 Width = 540 End Begin VB.TextBox TxtF @@ -522,10 +474,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00400000& Height = 360 Index = 5 - Left = 360 + Left = 6120 TabIndex = 7 Text = "0" - Top = 4560 + Top = 1200 Width = 540 End Begin VB.TextBox TxtF @@ -542,10 +494,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 4 - Left = 2760 + Left = 8520 TabIndex = 6 Text = "0" - Top = 4080 + Top = 720 Width = 540 End Begin VB.TextBox TxtF @@ -562,10 +514,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 3 - Left = 2160 + Left = 7920 TabIndex = 5 Text = "0" - Top = 4080 + Top = 720 Width = 540 End Begin VB.TextBox TxtF @@ -582,10 +534,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 2 - Left = 1560 + Left = 7320 TabIndex = 4 Text = "0" - Top = 4080 + Top = 720 Width = 540 End Begin VB.TextBox TxtF @@ -602,10 +554,10 @@ Begin VB.Form FormCustomFilter ForeColor = &H00800000& Height = 360 Index = 1 - Left = 960 + Left = 6720 TabIndex = 3 Text = "0" - Top = 4080 + Top = 720 Width = 540 End Begin VB.TextBox TxtF @@ -622,17 +574,17 @@ Begin VB.Form FormCustomFilter ForeColor = &H00400000& Height = 360 Index = 0 - Left = 360 + Left = 6120 TabIndex = 2 Text = "0" - Top = 4080 + Top = 720 Width = 540 End Begin PhotoDemon.jcbutton cmdOpen Height = 615 - Left = 3840 + Left = 6120 TabIndex = 29 - Top = 5730 + Top = 4800 Width = 900 _ExtentX = 1588 _ExtentY = 1085 @@ -659,9 +611,9 @@ Begin VB.Form FormCustomFilter End Begin PhotoDemon.jcbutton cmdSave Height = 615 - Left = 4920 + Left = 7200 TabIndex = 30 - Top = 5730 + Top = 4800 Width = 900 _ExtentX = 1588 _ExtentY = 1085 @@ -685,12 +637,21 @@ Begin VB.Form FormCustomFilter TooltipType = 1 TooltipTitle = "Save Current Filter" End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 37 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -720 - TabIndex = 40 - Top = 6840 - Width = 7095 + Left = 0 + TabIndex = 36 + Top = 5760 + Width = 10455 End Begin VB.Label lblAdditional AutoSize = -1 'True @@ -708,9 +669,9 @@ Begin VB.Form FormCustomFilter EndProperty ForeColor = &H00404040& Height = 285 - Left = 3720 - TabIndex = 39 - Top = 3600 + Left = 6000 + TabIndex = 35 + Top = 3240 Width = 2010 End Begin VB.Label lblOffset @@ -720,7 +681,7 @@ Begin VB.Form FormCustomFilter Caption = "offset:" BeginProperty Font Name = "Tahoma" - Size = 12 + Size = 11.25 Charset = 0 Weight = 400 Underline = 0 'False @@ -728,11 +689,11 @@ Begin VB.Form FormCustomFilter Strikethrough = 0 'False EndProperty ForeColor = &H00404040& - Height = 285 - Left = 3960 - TabIndex = 38 - Top = 4560 - Width = 675 + Height = 270 + Left = 8040 + TabIndex = 34 + Top = 3735 + Width = 645 End Begin VB.Label lblDivisor AutoSize = -1 'True @@ -741,7 +702,7 @@ Begin VB.Form FormCustomFilter Caption = "divisor:" BeginProperty Font Name = "Tahoma" - Size = 12 + Size = 11.25 Charset = 0 Weight = 400 Underline = 0 'False @@ -749,17 +710,17 @@ Begin VB.Form FormCustomFilter Strikethrough = 0 'False EndProperty ForeColor = &H00404040& - Height = 285 - Left = 3960 - TabIndex = 36 - Top = 4095 - Width = 795 + Height = 270 + Left = 6120 + TabIndex = 32 + Top = 3735 + Width = 675 End Begin VB.Label lblLoadSave AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent - Caption = "load / save filter:" + Caption = "load / save filter data:" BeginProperty Font Name = "Tahoma" Size = 12 @@ -771,10 +732,10 @@ Begin VB.Form FormCustomFilter EndProperty ForeColor = &H00404040& Height = 285 - Left = 3720 - TabIndex = 37 - Top = 5250 - Width = 1800 + Left = 6000 + TabIndex = 33 + Top = 4320 + Width = 2325 End Begin VB.Label lblConvolution AutoSize = -1 'True @@ -792,51 +753,11 @@ Begin VB.Form FormCustomFilter EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 35 - Top = 3600 + Left = 6000 + TabIndex = 31 + Top = 240 Width = 2070 End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 34 - Top = 2880 - Width = 480 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 33 - Top = 2880 - Width = 360 - End End Attribute VB_Name = "FormCustomFilter" Attribute VB_GlobalNameSpace = False @@ -915,19 +836,16 @@ Private Sub CmdCancel_Click() End Sub Private Sub Form_Activate() - - 'Draw the left preview - DrawPreviewImage picPreview - + 'If a filter has been used previously, load it from the temp file If g_HasCreatedFilter = True Then OpenCustomFilter g_UserPreferences.getTempPath & "~PD_CF.tmp" - - 'Draw the right preview - updatePreview - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview + updatePreview + End Sub Private Sub cmdOpen_Click() @@ -1131,7 +1049,7 @@ Private Sub updatePreview() g_FilterBias = Val(txtBias.Text) 'Apply the preview - DoFilter "Preview", False, , True, picEffect + DoFilter "Preview", False, , True, fxPreview End Sub diff --git a/Forms/VBP_FormDiffuse.frm b/Forms/VBP_FormDiffuse.frm index 50c89e941e..f2ab0f893d 100644 --- a/Forms/VBP_FormDiffuse.frm +++ b/Forms/VBP_FormDiffuse.frm @@ -3,10 +3,10 @@ Begin VB.Form FormDiffuse BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Custom Diffuse" - ClientHeight = 6780 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12210 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,90 +19,44 @@ Begin VB.Form FormDiffuse LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 452 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 814 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9240 TabIndex = 0 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10710 TabIndex = 1 - Top = 6150 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 10 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 9 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsY Height = 255 - Left = 240 + Left = 6120 Max = 10 TabIndex = 5 - Top = 4680 + Top = 3000 Value = 5 Width = 5055 End Begin VB.HScrollBar hsX Height = 255 - Left = 240 + Left = 6120 Max = 10 TabIndex = 3 - Top = 3840 + Top = 2160 Value = 5 Width = 5055 End @@ -119,10 +73,10 @@ Begin VB.Form FormDiffuse EndProperty ForeColor = &H00800000& Height = 315 - Left = 5400 + Left = 11280 TabIndex = 2 Text = "0" - Top = 3810 + Top = 2130 Width = 615 End Begin VB.TextBox txtY @@ -138,10 +92,10 @@ Begin VB.Form FormDiffuse EndProperty ForeColor = &H00800000& Height = 315 - Left = 5400 + Left = 11280 TabIndex = 4 Text = "0" - Top = 4650 + Top = 2970 Width = 615 End Begin VB.CheckBox ChkWrap @@ -159,57 +113,26 @@ Begin VB.Form FormDiffuse EndProperty ForeColor = &H00404040& Height = 375 - Left = 240 + Left = 6120 TabIndex = 6 - Top = 5280 + Top = 3600 Width = 2175 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 10 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 13 - Top = 6000 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 12 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 11 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 9 + Top = 5760 + Width = 12255 End Begin VB.Label Label2 AutoSize = -1 'True @@ -226,9 +149,9 @@ Begin VB.Form FormDiffuse EndProperty ForeColor = &H00404040& Height = 285 - Left = 120 + Left = 6000 TabIndex = 8 - Top = 4320 + Top = 2640 Width = 1785 End Begin VB.Label Label1 @@ -246,9 +169,9 @@ Begin VB.Form FormDiffuse EndProperty ForeColor = &H00404040& Height = 285 - Left = 120 + Left = 6000 TabIndex = 7 - Top = 3480 + Top = 1800 Width = 2085 End End @@ -276,7 +199,7 @@ Option Explicit Dim iWidth As Long, iHeight As Long Private Sub ChkWrap_Click() - If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, picEffect Else DiffuseCustom hsX.Value, hsY.Value, False, True, picEffect + If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, fxPreview Else DiffuseCustom hsX.Value, hsY.Value, False, True, fxPreview End Sub 'CANCEL button @@ -321,16 +244,13 @@ Private Sub Form_Activate() hsY.Max = pdImages(CurrentImage).Height - 1 hsX.Value = hsX.Max \ 2 hsY.Value = hsY.Max \ 2 - - 'Draw the left preview box (the original image) - DrawPreviewImage picPreview - - 'Draw the right preview box (the diffused effect) - If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, picEffect Else DiffuseCustom hsX.Value, hsY.Value, False, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview of the effect + If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, fxPreview Else DiffuseCustom hsX.Value, hsY.Value, False, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -340,22 +260,22 @@ End Sub 'Everything below this line relates to mirroring the input of the textboxes across the scrollbars (and vice versa) Private Sub hsX_Change() copyToTextBoxI txtX, hsX.Value - If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, picEffect Else DiffuseCustom hsX.Value, hsY.Value, False, True, picEffect + If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, fxPreview Else DiffuseCustom hsX.Value, hsY.Value, False, True, fxPreview End Sub Private Sub hsX_Scroll() copyToTextBoxI txtX, hsX.Value - If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, picEffect Else DiffuseCustom hsX.Value, hsY.Value, False, True, picEffect + If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, fxPreview Else DiffuseCustom hsX.Value, hsY.Value, False, True, fxPreview End Sub Private Sub hsY_Change() copyToTextBoxI txtY, hsY.Value - If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, picEffect Else DiffuseCustom hsX.Value, hsY.Value, False, True, picEffect + If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, fxPreview Else DiffuseCustom hsX.Value, hsY.Value, False, True, fxPreview End Sub Private Sub hsY_Scroll() copyToTextBoxI txtY, hsY.Value - If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, picEffect Else DiffuseCustom hsX.Value, hsY.Value, False, True, picEffect + If ChkWrap.Value = vbChecked Then DiffuseCustom hsX.Value, hsY.Value, True, True, fxPreview Else DiffuseCustom hsX.Value, hsY.Value, False, True, fxPreview End Sub Private Sub txtX_GotFocus() @@ -378,7 +298,7 @@ End Sub 'Custom diffuse effect ' Inputs: diameter in x direction, diameter in y direction, whether or not to wrap edge pixels, and optional preview settings -Public Sub DiffuseCustom(ByVal xDiffuse As Long, ByVal yDiffuse As Long, ByVal wrapPixels As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub DiffuseCustom(ByVal xDiffuse As Long, ByVal yDiffuse As Long, ByVal wrapPixels As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Simulating large image explosion..." diff --git a/Forms/VBP_FormEmbossEngrave.frm b/Forms/VBP_FormEmbossEngrave.frm index d8ba77709f..1a99f1a1b5 100644 --- a/Forms/VBP_FormEmbossEngrave.frm +++ b/Forms/VBP_FormEmbossEngrave.frm @@ -3,10 +3,10 @@ Begin VB.Form FormEmbossEngrave BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Emboss/Engrave" - ClientHeight = 6165 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 11820 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,75 +19,29 @@ Begin VB.Form FormEmbossEngrave LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 411 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 788 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 8880 TabIndex = 0 - Top = 5550 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10350 TabIndex = 1 - Top = 5550 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 7 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End Begin VB.OptionButton OptEmboss Appearance = 0 'Flat BackColor = &H80000005& @@ -103,9 +57,9 @@ Begin VB.Form FormEmbossEngrave EndProperty ForeColor = &H00404040& Height = 345 - Left = 1560 + Left = 7200 TabIndex = 2 - Top = 3420 + Top = 1620 Value = -1 'True Width = 1215 End @@ -124,9 +78,9 @@ Begin VB.Form FormEmbossEngrave EndProperty ForeColor = &H00404040& Height = 345 - Left = 3480 + Left = 9120 TabIndex = 3 - Top = 3420 + Top = 1620 Width = 1335 End Begin VB.PictureBox PicColor @@ -143,11 +97,11 @@ Begin VB.Form FormEmbossEngrave EndProperty ForeColor = &H80000008& Height = 495 - Left = 360 + Left = 6000 ScaleHeight = 465 ScaleWidth = 5505 TabIndex = 5 - Top = 4560 + Top = 2760 Width = 5535 End Begin VB.CheckBox ChkToColor @@ -165,11 +119,20 @@ Begin VB.Form FormEmbossEngrave EndProperty ForeColor = &H00404040& Height = 375 - Left = 360 + Left = 6000 TabIndex = 4 - Top = 4080 + Top = 2280 Width = 5655 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 7 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground BeginProperty Font Name = "Arial" @@ -181,50 +144,10 @@ Begin VB.Form FormEmbossEngrave Strikethrough = 0 'False EndProperty Height = 855 - Left = -840 - TabIndex = 10 - Top = 5400 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 9 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 8 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 6 + Top = 5760 + Width = 11895 End End Attribute VB_Name = "FormEmbossEngrave" @@ -247,11 +170,7 @@ Attribute VB_Exposed = False Option Explicit Private Sub ChkToColor_Click() - If OptEmboss.Value = True Then - If ChkToColor.Value = vbChecked Then FilterEmbossColor PicColor.backColor, True, picEffect Else FilterEmbossColor RGB(127, 127, 127), True, picEffect - Else - If ChkToColor.Value = vbChecked Then FilterEngraveColor PicColor.backColor, True, picEffect Else FilterEngraveColor RGB(127, 127, 127), True, picEffect - End If + UpdateEmbossPreview End Sub 'CANCEL button @@ -280,21 +199,14 @@ Private Sub Form_Activate() 'Remember the last emboss/engrave color selection PicColor.backColor = g_EmbossEngraveColor - - 'Draw a preview of the current image to the left box - DrawPreviewImage picPreview - - 'Draw a preview of the emboss/engrave effect to the right box - If OptEmboss.Value = True Then - If ChkToColor.Value = vbChecked Then FilterEmbossColor PicColor.backColor, True, picEffect Else FilterEmbossColor RGB(127, 127, 127), True, picEffect - Else - If ChkToColor.Value = vbChecked Then FilterEngraveColor PicColor.backColor, True, picEffect Else FilterEngraveColor RGB(127, 127, 127), True, picEffect - End If - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me setHandCursor PicColor + 'Render a preview of the emboss/engrave effect + UpdateEmbossPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -303,19 +215,11 @@ End Sub 'When the emboss/engrave options are clicked, redraw the preview Private Sub OptEmboss_Click() - If OptEmboss.Value = True Then - If ChkToColor.Value = vbChecked Then FilterEmbossColor PicColor.backColor, True, picEffect Else FilterEmbossColor RGB(127, 127, 127), True, picEffect - Else - If ChkToColor.Value = vbChecked Then FilterEngraveColor PicColor.backColor, True, picEffect Else FilterEngraveColor RGB(127, 127, 127), True, picEffect - End If + UpdateEmbossPreview End Sub Private Sub OptEngrave_Click() - If OptEmboss.Value = True Then - If ChkToColor.Value = vbChecked Then FilterEmbossColor PicColor.backColor, True, picEffect Else FilterEmbossColor RGB(127, 127, 127), True, picEffect - Else - If ChkToColor.Value = vbChecked Then FilterEngraveColor PicColor.backColor, True, picEffect Else FilterEngraveColor RGB(127, 127, 127), True, picEffect - End If + UpdateEmbossPreview End Sub 'Clicking on the picture box allows the user to select a new color @@ -330,18 +234,14 @@ Private Sub PicColor_Click() If CD1.VBChooseColor(retColor, True, True, False, Me.hWnd) Then PicColor.backColor = retColor ChkToColor.Value = vbChecked - If OptEmboss.Value = True Then - If ChkToColor.Value = vbChecked Then FilterEmbossColor PicColor.backColor, True, picEffect Else FilterEmbossColor RGB(127, 127, 127), True, picEffect - Else - If ChkToColor.Value = vbChecked Then FilterEngraveColor PicColor.backColor, True, picEffect Else FilterEngraveColor RGB(127, 127, 127), True, picEffect - End If + UpdateEmbossPreview End If End Sub 'Emboss an image ' Inputs: color to emboss to, and whether or not this is a preview (plus the destination picture box if it IS a preview) -Public Sub FilterEmbossColor(ByVal cColor As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterEmbossColor(ByVal cColor As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Embossing image..." @@ -449,7 +349,7 @@ End Sub 'Engrave an image ' Inputs: color to emboss to, and whether or not this is a preview (plus the destination picture box if it IS a preview) -Public Sub FilterEngraveColor(ByVal cColor As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterEngraveColor(ByVal cColor As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Embossing image..." @@ -554,3 +454,12 @@ Public Sub FilterEngraveColor(ByVal cColor As Long, Optional ByVal toPreview As finalizeImageData toPreview, dstPic End Sub + +'Render a new preview +Private Sub UpdateEmbossPreview() + If OptEmboss.Value Then + If CBool(ChkToColor.Value) Then FilterEmbossColor PicColor.backColor, True, fxPreview Else FilterEmbossColor RGB(127, 127, 127), True, fxPreview + Else + If CBool(ChkToColor.Value) Then FilterEngraveColor PicColor.backColor, True, fxPreview Else FilterEngraveColor RGB(127, 127, 127), True, fxPreview + End If +End Sub diff --git a/Forms/VBP_FormEqualize.frm b/Forms/VBP_FormEqualize.frm index b02a444093..b8c76a9113 100644 --- a/Forms/VBP_FormEqualize.frm +++ b/Forms/VBP_FormEqualize.frm @@ -3,10 +3,10 @@ Begin VB.Form FormEqualize BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Equalize Histogram" - ClientHeight = 5580 + ClientHeight = 6555 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6270 + ClientWidth = 12105 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,27 +19,27 @@ Begin VB.Form FormEqualize LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 372 + ScaleHeight = 437 ScaleMode = 3 'Pixel - ScaleWidth = 418 + ScaleWidth = 807 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 4950 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 4950 + Top = 5910 Width = 1365 End Begin VB.CheckBox chkLuminance @@ -57,9 +57,9 @@ Begin VB.Form FormEqualize EndProperty ForeColor = &H00404040& Height = 345 - Left = 4440 - TabIndex = 10 - Top = 3960 + Left = 10200 + TabIndex = 6 + Top = 2760 Width = 1695 End Begin VB.CheckBox chkBlue @@ -77,9 +77,9 @@ Begin VB.Form FormEqualize EndProperty ForeColor = &H00404040& Height = 345 - Left = 3120 - TabIndex = 9 - Top = 3960 + Left = 8880 + TabIndex = 5 + Top = 2760 Width = 1215 End Begin VB.CheckBox chkGreen @@ -97,9 +97,9 @@ Begin VB.Form FormEqualize EndProperty ForeColor = &H00404040& Height = 345 - Left = 1680 - TabIndex = 8 - Top = 3960 + Left = 7440 + TabIndex = 4 + Top = 2760 Width = 1335 End Begin VB.CheckBox chkRed @@ -117,85 +117,26 @@ Begin VB.Form FormEqualize EndProperty ForeColor = &H00404040& Height = 345 - Left = 480 - TabIndex = 7 - Top = 3960 + Left = 6240 + TabIndex = 3 + Top = 2760 Width = 1095 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 2730 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 4 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 3 + TabIndex = 8 Top = 120 - Width = 2895 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -825 - TabIndex = 11 - Top = 4800 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 6 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 5 - Top = 2880 - Width = 480 + Left = 15 + TabIndex = 7 + Top = 5760 + Width = 12135 End Begin VB.Label lblEqualize AutoSize = -1 'True @@ -212,9 +153,9 @@ Begin VB.Form FormEqualize EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 2 - Top = 3480 + Top = 2280 Width = 945 End End @@ -241,19 +182,19 @@ Option Explicit 'Whenever a check box is changed, redraw the preview Private Sub chkBlue_Click() - EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, picEffect + EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, fxPreview End Sub Private Sub chkGreen_Click() - EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, picEffect + EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, fxPreview End Sub Private Sub chkLuminance_Click() - EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, picEffect + EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, fxPreview End Sub Private Sub chkRed_Click() - EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, picEffect + EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, fxPreview End Sub 'OK button @@ -274,9 +215,8 @@ End Sub Private Sub Form_Activate() - 'Create the previews - DrawPreviewImage picPreview - EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, picEffect + 'Render a preview + EqualizeHistogram CBool(chkRed.Value), CBool(chkGreen.Value), CBool(chkBlue.Value), CBool(chkLuminance.Value), True, fxPreview 'Assign the system hand cursor to all relevant objects makeFormPretty Me @@ -285,7 +225,7 @@ End Sub 'Equalize the red, green, blue, and/or Luminance channels of an image ' (Technically Luminance isn't a channel, but you know what I mean.) -Public Sub EqualizeHistogram(ByVal HandleR As Boolean, ByVal HandleG As Boolean, ByVal HandleB As Boolean, ByVal HandleL As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub EqualizeHistogram(ByVal HandleR As Boolean, ByVal HandleG As Boolean, ByVal HandleB As Boolean, ByVal HandleL As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Analyzing image histogram..." diff --git a/Forms/VBP_FormEtchGlass.frm b/Forms/VBP_FormEtchGlass.frm index eec8548ddb..dbf673107f 100644 --- a/Forms/VBP_FormEtchGlass.frm +++ b/Forms/VBP_FormEtchGlass.frm @@ -4,10 +4,10 @@ Begin VB.Form FormFiguredGlass BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Figured Glass" - ClientHeight = 9180 + ClientHeight = 6555 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 12090 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,36 +20,36 @@ Begin VB.Form FormFiguredGlass LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 612 + ScaleHeight = 437 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 806 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 8550 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 8550 + Top = 5910 Width = 1365 End Begin VB.HScrollBar hsScale Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = 1 - TabIndex = 11 - Top = 6060 + TabIndex = 10 + Top = 1860 Value = 50 Width = 4815 End @@ -66,11 +66,11 @@ Begin VB.Form FormFiguredGlass EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 10 + TabIndex = 9 Text = "50" - Top = 6000 + Top = 1800 Width = 735 End Begin VB.TextBox txtTurbulence @@ -86,20 +86,20 @@ Begin VB.Form FormFiguredGlass EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 8 + TabIndex = 7 Text = "50" - Top = 6780 + Top = 2580 Width = 735 End Begin VB.HScrollBar hsTurbulence Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = 1 - TabIndex = 7 - Top = 6840 + TabIndex = 6 + Top = 2640 Value = 50 Width = 4815 End @@ -119,9 +119,9 @@ Begin VB.Form FormFiguredGlass ForeColor = &H00404040& Height = 360 Index = 0 - Left = 360 - TabIndex = 6 - Top = 7680 + Left = 6120 + TabIndex = 5 + Top = 3480 Value = -1 'True Width = 1095 End @@ -141,31 +141,26 @@ Begin VB.Form FormFiguredGlass ForeColor = &H00404040& Height = 360 Index = 1 - Left = 1800 - TabIndex = 5 - Top = 7680 + Left = 7560 + TabIndex = 4 + Top = 3480 Width = 2535 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 5100 - Left = 240 - ScaleHeight = 338 - ScaleMode = 3 'Pixel - ScaleWidth = 382 - TabIndex = 3 - Top = 240 - Width = 5760 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 12 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 12 - Top = 8400 - Width = 7095 + Left = 0 + TabIndex = 11 + Top = 5760 + Width = 12135 End Begin VB.Label lblTitle AutoSize = -1 'True @@ -183,9 +178,9 @@ Begin VB.Form FormFiguredGlass ForeColor = &H00404040& Height = 285 Index = 1 - Left = 240 - TabIndex = 9 - Top = 6480 + Left = 6000 + TabIndex = 8 + Top = 2280 Width = 1200 End Begin VB.Label lblTitle @@ -206,9 +201,9 @@ Begin VB.Form FormFiguredGlass ForeColor = &H00404040& Height = 285 Index = 2 - Left = 240 - TabIndex = 4 - Top = 7320 + Left = 6000 + TabIndex = 3 + Top = 3120 Width = 1845 End Begin VB.Label lblTitle @@ -229,9 +224,9 @@ Begin VB.Form FormFiguredGlass ForeColor = &H00404040& Height = 285 Index = 0 - Left = 240 + Left = 6000 TabIndex = 2 - Top = 5640 + Top = 1440 Width = 600 End End @@ -304,7 +299,7 @@ Private Sub cmdOK_Click() End Sub 'Apply a "figured glass" effect to an image -Public Sub FiguredGlassFX(ByVal fxScale As Double, ByVal fxTurbulence As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FiguredGlassFX(ByVal fxScale As Double, ByVal fxTurbulence As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Projecting image through simulated glass..." @@ -511,9 +506,9 @@ End Sub Private Sub updatePreview() If OptInterpolate(0) Then - FiguredGlassFX CDbl(hsScale), CDbl(hsTurbulence / 100), True, True, picPreview + FiguredGlassFX CDbl(hsScale), CDbl(hsTurbulence / 100), True, True, fxPreview Else - FiguredGlassFX CDbl(hsScale), CDbl(hsTurbulence / 100), False, True, picPreview + FiguredGlassFX CDbl(hsScale), CDbl(hsTurbulence / 100), False, True, fxPreview End If End Sub diff --git a/Forms/VBP_FormFade.frm b/Forms/VBP_FormFade.frm index a6c6a5af24..5ffca91be0 100644 --- a/Forms/VBP_FormFade.frm +++ b/Forms/VBP_FormFade.frm @@ -3,10 +3,10 @@ Begin VB.Form FormFade BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Fade Image" - ClientHeight = 5460 + ClientHeight = 6555 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6270 + ClientWidth = 12090 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,82 +19,36 @@ Begin VB.Form FormFade LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 364 + ScaleHeight = 437 ScaleMode = 3 'Pixel - ScaleWidth = 418 + ScaleWidth = 806 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 4830 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 4830 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsPercent Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = 1 TabIndex = 3 - Top = 3840 + Top = 2760 Value = 50 Width = 4935 End @@ -111,59 +65,28 @@ Begin VB.Form FormFade EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 3 TabIndex = 2 Text = "50" - Top = 3780 + Top = 2700 Width = 615 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 6 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 9 - Top = 4680 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 7 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 5 + Top = 5760 + Width = 12135 End Begin VB.Label Label1 AutoSize = -1 'True @@ -180,9 +103,9 @@ Begin VB.Form FormFade EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 4 - Top = 3480 + Top = 2400 Width = 1980 End End @@ -221,7 +144,7 @@ End Sub 'Subroutine for fading an image to grayscale 'NOTE!! fadeRatio has been changed from a Long to a Single. Change the code accordingly when rewriting! -Public Sub FadeImage(ByVal fadeRatio As Single, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FadeImage(ByVal fadeRatio As Single, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Fading image..." @@ -297,7 +220,7 @@ Private Sub CmdCancel_Click() End Sub 'Unfade is literally a reverse fade - rather than pushing values toward gray, we push them away from it -Public Sub UnfadeImage(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub UnfadeImage(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Unfading image..." @@ -381,14 +304,13 @@ Public Sub UnfadeImage(Optional ByVal toPreview As Boolean = False, Optional ByR End Sub Private Sub Form_Activate() - - 'Create the previews - DrawPreviewImage picPreview - FadeImage CSng(hsPercent.Value / 100), True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview + FadeImage CSng(hsPercent.Value / 100), True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -397,12 +319,12 @@ End Sub Private Sub hsPercent_Change() copyToTextBoxI txtPercent, hsPercent.Value - FadeImage CSng(hsPercent.Value / 100), True, picEffect + FadeImage CSng(hsPercent.Value / 100), True, fxPreview End Sub Private Sub hsPercent_Scroll() copyToTextBoxI txtPercent, hsPercent.Value - FadeImage CSng(hsPercent.Value / 100), True, picEffect + FadeImage CSng(hsPercent.Value / 100), True, fxPreview End Sub Private Sub txtPercent_GotFocus() diff --git a/Forms/VBP_FormFindEdges.frm b/Forms/VBP_FormFindEdges.frm index 60b8883a11..e809cc7f54 100644 --- a/Forms/VBP_FormFindEdges.frm +++ b/Forms/VBP_FormFindEdges.frm @@ -3,10 +3,10 @@ Begin VB.Form FormFindEdges BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Find Edges" - ClientHeight = 6780 + ClientHeight = 6525 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6270 + ClientWidth = 12195 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,9 +19,9 @@ Begin VB.Form FormFindEdges LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 452 + ScaleHeight = 435 ScaleMode = 3 'Pixel - ScaleWidth = 418 + ScaleWidth = 813 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Visible = 0 'False @@ -29,18 +29,18 @@ Begin VB.Form FormFindEdges Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9240 TabIndex = 0 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10710 TabIndex = 1 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.CheckBox chkInvert @@ -58,55 +58,9 @@ Begin VB.Form FormFindEdges EndProperty ForeColor = &H00404040& Height = 375 - Left = 3240 - TabIndex = 9 - Top = 5160 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 + Left = 9120 TabIndex = 5 - Top = 120 + Top = 3240 Width = 2895 End Begin VB.ListBox LstEdgeOptions @@ -120,12 +74,21 @@ Begin VB.Form FormFindEdges Strikethrough = 0 'False EndProperty ForeColor = &H00404040& - Height = 1980 - Left = 120 + Height = 2460 + Left = 6000 TabIndex = 2 - Top = 3480 + Top = 1320 Width = 2895 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 7 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground BeginProperty Font Name = "Arial" @@ -137,50 +100,10 @@ Begin VB.Form FormFindEdges Strikethrough = 0 'False EndProperty Height = 855 - Left = -825 - TabIndex = 10 - Top = 6000 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 7 - Top = 2880 - Width = 480 + Left = 15 + TabIndex = 6 + Top = 5760 + Width = 12255 End Begin VB.Label Label1 BackStyle = 0 'Transparent @@ -196,9 +119,9 @@ Begin VB.Form FormFindEdges EndProperty ForeColor = &H00404040& Height = 375 - Left = 3240 + Left = 9120 TabIndex = 4 - Top = 3450 + Top = 1320 Width = 2055 End Begin VB.Label LblDesc @@ -217,9 +140,9 @@ Begin VB.Form FormFindEdges EndProperty ForeColor = &H00404040& Height = 1575 - Left = 3240 + Left = 9120 TabIndex = 3 - Top = 3840 + Top = 1800 Width = 2895 WordWrap = -1 'True End @@ -284,9 +207,6 @@ End Sub Private Sub Form_Activate() - 'Draw a preview of the current image to the left box - DrawPreviewImage picPreview - 'Generate a list box with all the various edge detection algorithms LstEdgeOptions.AddItem "Prewitt Horizontal" LstEdgeOptions.AddItem "Prewitt Vertical" @@ -299,16 +219,16 @@ Private Sub Form_Activate() LstEdgeOptions.AddItem "PhotoDemon Cubic" LstEdgeOptions.ListIndex = 5 + + 'Assign the system hand cursor to all relevant objects + makeFormPretty Me 'Update the descriptions (this will also draw a preview of the selected edge-detection algorithm) UpdateDescriptions - 'Assign the system hand cursor to all relevant objects - makeFormPretty Me - End Sub -Public Sub FilterHilite(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterHilite(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, -1) = -4 @@ -322,7 +242,7 @@ Public Sub FilterHilite(Optional ByVal blackBackground As Boolean = False, Optio DoFilter "Hilite edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub PhotoDemonCubicEdgeDetection(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub PhotoDemonCubicEdgeDetection(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 5 ReDim g_FM(-2 To 2, -2 To 2) As Long g_FM(-1, -2) = 1 @@ -335,7 +255,7 @@ Public Sub PhotoDemonCubicEdgeDetection(Optional ByVal blackBackground As Boolea DoFilter "PhotoDemon cubic edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub PhotoDemonLinearEdgeDetection(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub PhotoDemonLinearEdgeDetection(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, -1) = -1 @@ -348,7 +268,7 @@ Public Sub PhotoDemonLinearEdgeDetection(Optional ByVal blackBackground As Boole DoFilter "PhotoDemon linear edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub FilterPrewittHorizontal(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterPrewittHorizontal(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, -1) = -1 @@ -362,7 +282,7 @@ Public Sub FilterPrewittHorizontal(Optional ByVal blackBackground As Boolean = F DoFilter "Prewitt horizontal edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub FilterPrewittVertical(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterPrewittVertical(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, -1) = 1 @@ -376,7 +296,7 @@ Public Sub FilterPrewittVertical(Optional ByVal blackBackground As Boolean = Fal DoFilter "Prewitt vertical edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub FilterSobelHorizontal(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterSobelHorizontal(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, -1) = -1 @@ -390,7 +310,7 @@ Public Sub FilterSobelHorizontal(Optional ByVal blackBackground As Boolean = Fal DoFilter "Sobel horizontal edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub FilterSobelVertical(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterSobelVertical(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, -1) = 1 @@ -404,7 +324,7 @@ Public Sub FilterSobelVertical(Optional ByVal blackBackground As Boolean = False DoFilter "Sobel vertical edge detection", Not blackBackground, , toPreview, dstPic End Sub -Public Sub FilterLaplacian(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterLaplacian(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) g_FilterSize = 3 ReDim g_FM(-1 To 1, -1 To 1) As Long g_FM(-1, 0) = -1 @@ -419,7 +339,7 @@ End Sub 'This code is a modified version of an algorithm originally developed by Manuel Augusto Santos. A link to his original ' implementation is available from the "Help -> About PhotoDemon" menu option. -Public Sub FilterSmoothContour(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub FilterSmoothContour(Optional ByVal blackBackground As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Tracing image edges with virtual paintbrush..." @@ -539,31 +459,31 @@ Private Sub UpdateDescriptions() l = LstEdgeOptions.List(LstEdgeOptions.ListIndex) If l = "Prewitt Horizontal" Then LblDesc = "Simple matrix method:" & vbCrLf & vbCrLf & "-1 0 1" & vbCrLf & "-1 0 1" & vbCrLf & "-1 0 1" - FilterPrewittHorizontal CBool(chkInvert.Value), True, picEffect + FilterPrewittHorizontal CBool(chkInvert.Value), True, fxPreview ElseIf l = "Prewitt Vertical" Then LblDesc = "Simple matrix method:" & vbCrLf & vbCrLf & "-1 -1 -1" & vbCrLf & " 0 0 0" & vbCrLf & " 1 1 1" - FilterPrewittVertical CBool(chkInvert.Value), True, picEffect + FilterPrewittVertical CBool(chkInvert.Value), True, fxPreview ElseIf l = "Sobel Horizontal" Then LblDesc = "Simple matrix method:" & vbCrLf & vbCrLf & "-1 0 1" & vbCrLf & "-2 0 2" & vbCrLf & "-1 0 1" - FilterSobelHorizontal CBool(chkInvert.Value), True, picEffect + FilterSobelHorizontal CBool(chkInvert.Value), True, fxPreview ElseIf l = "Sobel Vertical" Then LblDesc = "Simple matrix method:" & vbCrLf & vbCrLf & "-1 -2 -1" & vbCrLf & " 0 0 0" & vbCrLf & " 1 2 1" - FilterSobelVertical CBool(chkInvert.Value), True, picEffect + FilterSobelVertical CBool(chkInvert.Value), True, fxPreview ElseIf l = "Laplacian" Then LblDesc = "Simple matrix method:" & vbCrLf & vbCrLf & " 0 -1 0" & vbCrLf & "-1 4 -1" & vbCrLf & " 0 -1 0" - FilterLaplacian CBool(chkInvert.Value), True, picEffect + FilterLaplacian CBool(chkInvert.Value), True, fxPreview ElseIf l = "Artistic Contour" Then LblDesc = "Algorithm designed to present a clean, artistic prediction of image edges." - FilterSmoothContour CBool(chkInvert.Value), True, picEffect + FilterSmoothContour CBool(chkInvert.Value), True, fxPreview ElseIf l = "Hilite" Then LblDesc = "Simple matrix method:" & vbCrLf & vbCrLf & "-4 -2 -1" & vbCrLf & "-2 10 0" & vbCrLf & "-1 0 0" - FilterHilite CBool(chkInvert.Value), True, picEffect + FilterHilite CBool(chkInvert.Value), True, fxPreview ElseIf l = "PhotoDemon Linear" Then LblDesc = "Simple mathematical routine based on linear relationships between diagonal pixels." - PhotoDemonLinearEdgeDetection CBool(chkInvert.Value), True, picEffect + PhotoDemonLinearEdgeDetection CBool(chkInvert.Value), True, fxPreview Else LblDesc = "Advanced mathematical routine based on cubic relationships between diagonal pixels." - PhotoDemonCubicEdgeDetection CBool(chkInvert.Value), True, picEffect + PhotoDemonCubicEdgeDetection CBool(chkInvert.Value), True, fxPreview End If End Sub diff --git a/Forms/VBP_FormGamma.frm b/Forms/VBP_FormGamma.frm index 41c314003b..62d3777b6e 100644 --- a/Forms/VBP_FormGamma.frm +++ b/Forms/VBP_FormGamma.frm @@ -3,10 +3,10 @@ Begin VB.Form FormGamma BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Gamma Correction" - ClientHeight = 6405 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12060 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,82 +19,36 @@ Begin VB.Form FormGamma LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 427 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 804 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 5790 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 5790 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 8 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 7 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsGamma Height = 255 - Left = 360 + Left = 6120 Max = 200 Min = 1 TabIndex = 3 - Top = 4920 + Top = 3240 Value = 100 Width = 4935 End @@ -111,11 +65,11 @@ Begin VB.Form FormGamma EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 4 TabIndex = 4 Text = "1.00" - Top = 4860 + Top = 3180 Width = 615 End Begin VB.ComboBox CboChannel @@ -131,12 +85,21 @@ Begin VB.Form FormGamma EndProperty ForeColor = &H00800000& Height = 360 - Left = 360 + Left = 6120 Style = 2 'Dropdown List TabIndex = 2 - Top = 3840 + Top = 2160 Width = 1935 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 8 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground BeginProperty Font Name = "MS Sans Serif" @@ -148,50 +111,10 @@ Begin VB.Form FormGamma Strikethrough = 0 'False EndProperty Height = 855 - Left = -840 - TabIndex = 11 - Top = 5640 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 10 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 9 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 7 + Top = 5760 + Width = 12135 End Begin VB.Label Label2 AutoSize = -1 'True @@ -208,9 +131,9 @@ Begin VB.Form FormGamma EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 6 - Top = 4560 + Top = 2880 Width = 960 End Begin VB.Label Label1 @@ -228,9 +151,9 @@ Begin VB.Form FormGamma EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 5 - Top = 3480 + Top = 1800 Width = 900 End End @@ -255,7 +178,7 @@ Option Explicit 'Update the preview when the user changes the channel combo box Private Sub CboChannel_Click() - GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, picEffect + GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, fxPreview End Sub 'CANCEL button @@ -277,27 +200,25 @@ End Sub Private Sub Form_Activate() - 'Draw a preview of the current image to the left picture box - DrawPreviewImage picPreview - + 'Populate the channels that gamma correction can operate on CboChannel.AddItem "RGB", 0 CboChannel.AddItem "Red", 1 CboChannel.AddItem "Green", 2 CboChannel.AddItem "Blue", 3 CboChannel.ListIndex = 0 DoEvents - - 'Now, draw a preview of the gamma effect to the right picture box - GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Finally, render a preview + GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, fxPreview + End Sub 'Basic gamma correction. It's a simple function - use an exponent to adjust R/G/B values. ' Inputs: new gamma level, which channels to adjust (r/g/b/all), and optional preview information -Public Sub GammaCorrect(ByVal Gamma As Single, ByVal Method As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub GammaCorrect(ByVal Gamma As Single, ByVal Method As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Adjusting gamma values..." @@ -394,13 +315,13 @@ End Sub Private Sub hsGamma_Change() txtGamma.Text = Format(CSng(hsGamma.Value) / 100, "0.00") txtGamma.Refresh - GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, picEffect + GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, fxPreview End Sub Private Sub hsGamma_Scroll() txtGamma.Text = Format(CSng(hsGamma.Value) / 100, "0.00") txtGamma.Refresh - GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, picEffect + GammaCorrect CSng(Val(txtGamma)), CByte(CboChannel.ListIndex), True, fxPreview End Sub Private Sub txtGamma_GotFocus() diff --git a/Forms/VBP_FormGrayscale.frm b/Forms/VBP_FormGrayscale.frm index c316532010..e4263efdb2 100644 --- a/Forms/VBP_FormGrayscale.frm +++ b/Forms/VBP_FormGrayscale.frm @@ -3,10 +3,10 @@ Begin VB.Form FormGrayscale BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " " - ClientHeight = 6885 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 10350 + ClientWidth = 11895 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,85 +19,46 @@ Begin VB.Form FormGrayscale LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 459 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 690 + ScaleWidth = 793 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Visible = 0 'False + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 15 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 7320 + Left = 8910 TabIndex = 0 - Top = 6270 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 8790 + Left = 10380 TabIndex = 1 - Top = 6270 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 4080 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 13 - TabStop = 0 'False - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 7200 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 12 - TabStop = 0 'False - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsShades Height = 255 - Left = 4320 + Left = 6120 Max = 254 Min = 2 TabIndex = 4 - Top = 5280 + Top = 3240 Value = 3 Width = 4785 End @@ -113,12 +74,12 @@ Begin VB.Form FormGrayscale Strikethrough = 0 'False EndProperty ForeColor = &H00800000& - Height = 315 - Left = 9240 + Height = 360 + Left = 11040 MaxLength = 3 TabIndex = 3 Text = "3" - Top = 5250 + Top = 3195 Visible = 0 'False Width = 615 End @@ -135,10 +96,10 @@ Begin VB.Form FormGrayscale EndProperty ForeColor = &H00800000& Height = 330 - Left = 4320 + Left = 6120 Style = 2 'Dropdown List TabIndex = 2 - Top = 4080 + Top = 2040 Width = 3975 End Begin VB.PictureBox picChannel @@ -147,11 +108,11 @@ Begin VB.Form FormGrayscale BorderStyle = 0 'None ForeColor = &H80000008& Height = 375 - Left = 4320 + Left = 6120 ScaleHeight = 375 ScaleWidth = 3855 - TabIndex = 15 - Top = 5280 + TabIndex = 13 + Top = 3240 Width = 3855 Begin VB.OptionButton optChannel Appearance = 0 'Flat @@ -224,11 +185,11 @@ Begin VB.Form FormGrayscale BorderStyle = 0 'None ForeColor = &H80000008& Height = 375 - Left = 4320 + Left = 6120 ScaleHeight = 375 ScaleWidth = 3975 - TabIndex = 14 - Top = 5280 + TabIndex = 12 + Top = 3240 Width = 3975 Begin VB.OptionButton optDecompose Appearance = 0 'Flat @@ -274,125 +235,10 @@ Begin VB.Form FormGrayscale Width = 1455 End End - Begin VB.Label lblLink - Alignment = 2 'Center - Appearance = 0 'Flat - BackColor = &H80000005& - BackStyle = 0 'Transparent - Caption = "Grayscale Conversion: An In-Depth Look" - BeginProperty Font - Name = "Tahoma" - Size = 9 - Charset = 0 - Weight = 400 - Underline = -1 'True - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00FFCBA1& - Height = 255 - Left = 120 - MouseIcon = "VBP_FormGrayscale.frx":0000 - MousePointer = 99 'Custom - TabIndex = 21 - Top = 6375 - Width = 3495 - End - Begin VB.Label lblExplanation - BackStyle = 0 'Transparent - Caption = "(Description appears here)" - BeginProperty Font - Name = "Tahoma" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00E0E0E0& - Height = 5415 - Left = 360 - TabIndex = 20 - Top = 930 - Width = 3135 - End - Begin VB.Label lblTitle - Alignment = 2 'Center - Appearance = 0 'Flat - BackColor = &H80000005& - BackStyle = 0 'Transparent - Caption = "grayscale tool" - BeginProperty Font - Name = "Tahoma" - Size = 17.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00FFFFFF& - Height = 540 - Left = 0 - TabIndex = 19 - Top = 240 - Width = 3825 - End - Begin VB.Label lblBackColor - Appearance = 0 'Flat - BackColor = &H00404040& - ForeColor = &H80000008& - Height = 6870 - Left = 0 - TabIndex = 18 - Top = 0 - Width = 3825 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 7320 - TabIndex = 17 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 4200 - TabIndex = 16 - Top = 2880 - Width = 480 - End Begin VB.Label lblAdditional AutoSize = -1 'True BackStyle = 0 'Transparent - Caption = "additional options for this method:" + Caption = "additional options:" BeginProperty Font Name = "Tahoma" Size = 12 @@ -404,10 +250,10 @@ Begin VB.Form FormGrayscale EndProperty ForeColor = &H00404040& Height = 285 - Left = 4200 + Left = 6000 TabIndex = 11 - Top = 4800 - Width = 3690 + Top = 2760 + Width = 1980 End Begin VB.Label lblAlgorithm AutoSize = -1 'True @@ -424,17 +270,17 @@ Begin VB.Form FormGrayscale EndProperty ForeColor = &H00404040& Height = 285 - Left = 4200 + Left = 6000 TabIndex = 10 - Top = 3645 + Top = 1605 Width = 1950 End Begin VB.Label lblBackground Height = 855 - Left = 3240 - TabIndex = 22 - Top = 6120 - Width = 7095 + Left = 0 + TabIndex = 14 + Top = 5760 + Width = 13455 End End Attribute VB_Name = "FormGrayscale" @@ -464,29 +310,29 @@ Private Sub drawGrayscalePreview() Select Case cboMethod.ListIndex Case 0 - MenuGrayscaleAverage True, picEffect + MenuGrayscaleAverage True, fxPreview Case 1 - MenuGrayscale True, picEffect + MenuGrayscale True, fxPreview Case 2 - MenuDesaturate True, picEffect + MenuDesaturate True, fxPreview Case 3 If optDecompose(0).Value = True Then - MenuDecompose 0, True, picEffect + MenuDecompose 0, True, fxPreview Else - MenuDecompose 1, True, picEffect + MenuDecompose 1, True, fxPreview End If Case 4 If OptChannel(0).Value = True Then - MenuGrayscaleSingleChannel 0, True, picEffect + MenuGrayscaleSingleChannel 0, True, fxPreview ElseIf OptChannel(1).Value = True Then - MenuGrayscaleSingleChannel 1, True, picEffect + MenuGrayscaleSingleChannel 1, True, fxPreview Else - MenuGrayscaleSingleChannel 2, True, picEffect + MenuGrayscaleSingleChannel 2, True, fxPreview End If Case 5 - fGrayscaleCustom hsShades.Value, True, picEffect + fGrayscaleCustom hsShades.Value, True, fxPreview Case 6 - fGrayscaleCustomDither hsShades.Value, True, picEffect + fGrayscaleCustomDither hsShades.Value, True, fxPreview End Select End If @@ -608,10 +454,10 @@ Private Sub Form_Activate() UpdateVisibleControls 'Populate the explanation label - lblExplanation = "This tool removes color data from an image. The new image contains only shades of gray." & vbCrLf & vbCrLf & "Sometimes this tool is called a ""black and white"" tool, but that name is misleading because the processed image contains many more shades than just ""black"" and ""white"". A separate ""Black and White"" tool (found in the ""Color"" menu) exists if you want an image with just black and just white." & vbCrLf & vbCrLf & "While there are many ways to remove color from an image, most users stick with the ""Highest Quality (ITU Standard)"" method, which produces the best grayscale image. Other options are provided for artistic effect." & vbCrLf & vbCrLf & "To learn more about the various grayscale conversion options, please visit this link:" + 'lblExplanation = "This tool removes color data from an image. The new image contains only shades of gray." & vbCrLf & vbCrLf & "Sometimes this tool is called a ""black and white"" tool, but that name is misleading because the processed image contains many more shades than just ""black"" and ""white"". A separate ""Black and White"" tool (found in the ""Color"" menu) exists if you want an image with just black and just white." & vbCrLf & vbCrLf & "While there are many ways to remove color from an image, most users stick with the ""Highest Quality (ITU Standard)"" method, which produces the best grayscale image. Other options are provided for artistic effect." & vbCrLf & vbCrLf & "To learn more about the various grayscale conversion options, please visit this link:" 'Render the preview images - DrawPreviewImage picPreview + 'DrawPreviewImage picPreview 'Assign the system hand cursor to all relevant objects makeFormPretty Me @@ -622,7 +468,7 @@ Private Sub Form_Activate() End Sub 'Reduce to X # gray shades -Public Sub fGrayscaleCustom(ByVal numOfShades As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub fGrayscaleCustom(ByVal numOfShades As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Converting image to " & numOfShades & " shades of gray..." @@ -705,7 +551,7 @@ Public Sub fGrayscaleCustom(ByVal numOfShades As Long, Optional ByVal toPreview End Sub 'Reduce to X # gray shades (dithered) -Public Sub fGrayscaleCustomDither(ByVal numOfShades As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub fGrayscaleCustomDither(ByVal numOfShades As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Converting to " & numOfShades & " shades of gray, with dithering..." @@ -809,7 +655,7 @@ Public Sub fGrayscaleCustomDither(ByVal numOfShades As Long, Optional ByVal toPr End Sub 'Reduce to gray via (r+g+b)/3 -Public Sub MenuGrayscaleAverage(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub MenuGrayscaleAverage(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Converting image to grayscale..." @@ -881,7 +727,7 @@ Public Sub MenuGrayscaleAverage(Optional ByVal toPreview As Boolean = False, Opt End Sub 'Reduce to gray in a more human-eye friendly manner -Public Sub MenuGrayscale(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub MenuGrayscale(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Generating ITU-R compatible grayscale image..." @@ -948,7 +794,7 @@ Public Sub MenuGrayscale(Optional ByVal toPreview As Boolean = False, Optional B End Sub 'Reduce to gray via HSL -> convert S to 0 -Public Sub MenuDesaturate(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub MenuDesaturate(Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Desaturating image..." @@ -1014,7 +860,7 @@ Public Sub MenuDesaturate(Optional ByVal toPreview As Boolean = False, Optional End Sub 'Reduce to gray by selecting the minimum (maxOrMin = 0) or maximum (maxOrMin = 1) color in each pixel -Public Sub MenuDecompose(ByVal maxOrMin As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub MenuDecompose(ByVal maxOrMin As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Decomposing image..." @@ -1080,7 +926,7 @@ Public Sub MenuDecompose(ByVal maxOrMin As Long, Optional ByVal toPreview As Boo End Sub 'Reduce to gray by selecting a single color channel (represeted by cChannel: 0 = Red, 1 = Green, 2 = Blue) -Public Sub MenuGrayscaleSingleChannel(ByVal cChannel As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub MenuGrayscaleSingleChannel(ByVal cChannel As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) Dim cString As String @@ -1178,10 +1024,6 @@ Private Sub hsShades_Scroll() drawGrayscalePreview End Sub -Private Sub lblLink_Click() - OpenURL "http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/" -End Sub - 'When option buttons are used, update the preview accordingly Private Sub optChannel_Click(Index As Integer) drawGrayscalePreview diff --git a/Forms/VBP_FormGrayscale.frx b/Forms/VBP_FormGrayscale.frx deleted file mode 100644 index b674b3af11e0717f6591ab8ba7eb0df5b272be3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338 zcma*hJr06E7=+)HrgaMI9??-wU2e0Kl< diff --git a/Forms/VBP_FormHSL.frm b/Forms/VBP_FormHSL.frm index 3769698af9..02d1f1f2bb 100644 --- a/Forms/VBP_FormHSL.frm +++ b/Forms/VBP_FormHSL.frm @@ -3,10 +3,10 @@ Begin VB.Form FormHSL BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Adjust Hue / Saturation / Lightness" - ClientHeight = 7020 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12090 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,27 +19,27 @@ Begin VB.Form FormHSL LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 468 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 806 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 6390 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 6390 + Top = 5910 Width = 1365 End Begin VB.TextBox txtLuminance @@ -55,20 +55,20 @@ Begin VB.Form FormHSL EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 4 - TabIndex = 14 + TabIndex = 10 Text = "0" - Top = 5475 + Top = 3435 Width = 615 End Begin VB.HScrollBar hsLuminance Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = -100 - TabIndex = 12 - Top = 5520 + TabIndex = 8 + Top = 3480 Width = 4935 End Begin VB.TextBox txtSaturation @@ -84,20 +84,20 @@ Begin VB.Form FormHSL EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 4 - TabIndex = 11 + TabIndex = 7 Text = "0" - Top = 4635 + Top = 2595 Width = 615 End Begin VB.HScrollBar hsSaturation Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = -100 - TabIndex = 9 - Top = 4680 + TabIndex = 5 + Top = 2640 Width = 4935 End Begin VB.TextBox txtHue @@ -113,74 +113,37 @@ Begin VB.Form FormHSL EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 4 - TabIndex = 8 + TabIndex = 4 Text = "0" - Top = 3795 + Top = 1755 Width = 615 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 4 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 3 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsHue Height = 255 - Left = 360 + Left = 6120 Max = 180 Min = -180 TabIndex = 2 - Top = 3840 + Top = 1800 Width = 4935 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 12 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 15 - Top = 6240 - Width = 7095 + Left = 0 + TabIndex = 11 + Top = 5760 + Width = 12135 End Begin VB.Label lblLuminance AutoSize = -1 'True @@ -197,9 +160,9 @@ Begin VB.Form FormHSL EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 13 - Top = 5160 + Left = 6000 + TabIndex = 9 + Top = 3120 Width = 1020 End Begin VB.Label lblSaturation @@ -217,9 +180,9 @@ Begin VB.Form FormHSL EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 10 - Top = 4320 + Left = 6000 + TabIndex = 6 + Top = 2280 Width = 1140 End Begin VB.Label lblHue @@ -237,49 +200,9 @@ Begin VB.Form FormHSL EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 7 - Top = 3480 - Width = 480 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 6 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 5 - Top = 2880 + Left = 6000 + TabIndex = 3 + Top = 1440 Width = 480 End End @@ -319,7 +242,7 @@ End Sub 'Colorize an image using a hue defined between -1 and 5 ' Input: desired hue, whether to force saturation to 0.5 or maintain the existing value -Public Sub AdjustImageHSL(ByVal hModifier As Single, ByVal sModifier As Single, ByVal lModifier As Single, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub AdjustImageHSL(ByVal hModifier As Single, ByVal sModifier As Single, ByVal lModifier As Single, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Adjusting hue, saturation, and luminance values..." @@ -406,16 +329,13 @@ Public Sub AdjustImageHSL(ByVal hModifier As Single, ByVal sModifier As Single, End Sub Private Sub Form_Activate() - - 'Create a copy of the image on the preview window - DrawPreviewImage picPreview - - 'Display the previewed effect in the neighboring window - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Display the previewed effect in the neighboring window + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -425,32 +345,32 @@ End Sub 'When the hue scroll bar is changed, redraw the preview Private Sub hsHue_Change() copyToTextBoxI txtHue, hsHue.Value - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview End Sub Private Sub hsHue_Scroll() copyToTextBoxI txtHue, hsHue.Value - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview End Sub Private Sub hsLuminance_Change() copyToTextBoxI txtLuminance, hsLuminance.Value - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview End Sub Private Sub hsLuminance_Scroll() copyToTextBoxI txtLuminance, hsLuminance.Value - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview End Sub Private Sub hsSaturation_Change() copyToTextBoxI txtSaturation, hsSaturation.Value - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview End Sub Private Sub hsSaturation_Scroll() copyToTextBoxI txtSaturation, hsSaturation.Value - AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, picEffect + AdjustImageHSL CSng(hsHue.Value), CSng(hsSaturation.Value), CSng(hsLuminance.Value), True, fxPreview End Sub Private Sub txtHue_GotFocus() diff --git a/Forms/VBP_FormImageLevels.frm b/Forms/VBP_FormImageLevels.frm index e4b61206f7..5ca49c9014 100644 --- a/Forms/VBP_FormImageLevels.frm +++ b/Forms/VBP_FormImageLevels.frm @@ -4,10 +4,10 @@ Begin VB.Form FormLevels BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Adjust Image Levels" - ClientHeight = 6765 + ClientHeight = 6525 ClientLeft = 45 ClientTop = 195 - ClientWidth = 6255 + ClientWidth = 12180 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,135 +20,98 @@ Begin VB.Form FormLevels LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 451 + ScaleHeight = 435 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 812 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9240 TabIndex = 0 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10710 TabIndex = 1 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.HScrollBar hsOutL Height = 220 - Left = 1680 + Left = 7440 Max = 255 TabIndex = 5 - Top = 5040 + Top = 3360 Width = 3975 End Begin VB.HScrollBar hsOutR Height = 220 - Left = 1680 + Left = 7440 Max = 255 TabIndex = 6 - Top = 5280 + Top = 3600 Value = 255 Width = 3975 End Begin VB.HScrollBar hsInR Height = 220 - Left = 1680 + Left = 7440 Max = 255 Min = 2 TabIndex = 4 - Top = 4200 + Top = 2520 Value = 255 Width = 3975 End Begin VB.HScrollBar hsInL Height = 220 - Left = 1680 + Left = 7440 Max = 253 TabIndex = 2 - Top = 3720 + Top = 2040 Width = 3975 End Begin VB.HScrollBar hsInM Height = 220 - Left = 1680 + Left = 7440 Max = 254 Min = 1 TabIndex = 3 - Top = 3960 + Top = 2280 Value = 127 Width = 3975 End Begin VB.CommandButton cmdReset Appearance = 0 'Flat - Caption = "&Reset" + Caption = "&Reset levels" Height = 495 - Left = 180 + Left = 6000 TabIndex = 7 - Top = 6150 + Top = 5880 Width = 1455 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 8 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 9 + TabIndex = 26 Top = 120 - Width = 2895 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 29 - Top = 6000 - Width = 7095 + Left = 0 + TabIndex = 25 + Top = 5760 + Width = 12255 End Begin VB.Label Label9 Alignment = 1 'Right Justify @@ -157,9 +120,9 @@ Begin VB.Form FormLevels Caption = "0" ForeColor = &H00800000& Height = 195 - Left = 1560 - TabIndex = 28 - Top = 3720 + Left = 7320 + TabIndex = 24 + Top = 2040 Width = 90 End Begin VB.Label Label7 @@ -169,9 +132,9 @@ Begin VB.Form FormLevels Caption = "1" ForeColor = &H00800000& Height = 195 - Left = 1545 - TabIndex = 27 - Top = 5040 + Left = 7305 + TabIndex = 23 + Top = 3360 Width = 90 End Begin VB.Label Label4 @@ -181,51 +144,11 @@ Begin VB.Form FormLevels Caption = "1" ForeColor = &H00800000& Height = 195 - Left = 1545 - TabIndex = 26 - Top = 5280 + Left = 7305 + TabIndex = 22 + Top = 3600 Width = 90 End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 25 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 24 - Top = 2880 - Width = 480 - End Begin VB.Label lblOutput AutoSize = -1 'True BackStyle = 0 'Transparent @@ -241,9 +164,9 @@ Begin VB.Form FormLevels EndProperty ForeColor = &H00404040& Height = 405 - Left = 240 - TabIndex = 23 - Top = 4650 + Left = 6000 + TabIndex = 21 + Top = 2970 Width = 1440 End Begin VB.Label lblOutputL @@ -252,9 +175,9 @@ Begin VB.Form FormLevels Caption = "Left limit:" ForeColor = &H00800000& Height = 195 - Left = 360 - TabIndex = 22 - Top = 5040 + Left = 6120 + TabIndex = 20 + Top = 3360 Width = 660 End Begin VB.Label Label1 @@ -266,9 +189,9 @@ Begin VB.Form FormLevels Caption = "255" ForeColor = &H00800000& Height = 195 - Left = 5745 - TabIndex = 21 - Top = 5040 + Left = 11505 + TabIndex = 19 + Top = 3360 Width = 270 End Begin VB.Label Label2 @@ -277,9 +200,9 @@ Begin VB.Form FormLevels Caption = "Right limit:" ForeColor = &H00800000& Height = 195 - Left = 360 - TabIndex = 20 - Top = 5280 + Left = 6120 + TabIndex = 18 + Top = 3600 Width = 750 End Begin VB.Label Label3 @@ -291,9 +214,9 @@ Begin VB.Form FormLevels Caption = "255" ForeColor = &H00800000& Height = 195 - Left = 5745 - TabIndex = 19 - Top = 5280 + Left = 11505 + TabIndex = 17 + Top = 3600 Width = 270 End Begin VB.Label lblInput @@ -311,9 +234,9 @@ Begin VB.Form FormLevels EndProperty ForeColor = &H00404040& Height = 405 - Left = 240 - TabIndex = 18 - Top = 3330 + Left = 6000 + TabIndex = 16 + Top = 1650 Width = 1290 End Begin VB.Label Label5 @@ -325,9 +248,9 @@ Begin VB.Form FormLevels Caption = "255" ForeColor = &H00800000& Height = 195 - Left = 5745 - TabIndex = 17 - Top = 4200 + Left = 11505 + TabIndex = 15 + Top = 2520 Width = 270 End Begin VB.Label Label6 @@ -336,9 +259,9 @@ Begin VB.Form FormLevels Caption = "Right limit:" ForeColor = &H00800000& Height = 195 - Left = 360 - TabIndex = 16 - Top = 4200 + Left = 6120 + TabIndex = 14 + Top = 2520 Width = 750 End Begin VB.Label lblLeftR @@ -349,9 +272,9 @@ Begin VB.Form FormLevels Caption = "253" ForeColor = &H00800000& Height = 195 - Left = 5745 - TabIndex = 15 - Top = 3720 + Left = 11505 + TabIndex = 13 + Top = 2040 Width = 270 End Begin VB.Label Label8 @@ -360,9 +283,9 @@ Begin VB.Form FormLevels Caption = "Left limit:" ForeColor = &H00800000& Height = 195 - Left = 360 - TabIndex = 14 - Top = 3720 + Left = 6120 + TabIndex = 12 + Top = 2040 Width = 660 End Begin VB.Label lblMiddleR @@ -373,9 +296,9 @@ Begin VB.Form FormLevels Caption = "254" ForeColor = &H00800000& Height = 195 - Left = 5745 - TabIndex = 13 - Top = 3960 + Left = 11505 + TabIndex = 11 + Top = 2280 Width = 270 End Begin VB.Label Label10 @@ -384,9 +307,9 @@ Begin VB.Form FormLevels Caption = "Midtones:" ForeColor = &H00800000& Height = 195 - Left = 360 - TabIndex = 12 - Top = 3960 + Left = 6120 + TabIndex = 10 + Top = 2280 Width = 705 End Begin VB.Label lblMiddleL @@ -396,9 +319,9 @@ Begin VB.Form FormLevels Caption = "1" ForeColor = &H00800000& Height = 195 - Left = 1545 - TabIndex = 11 - Top = 3960 + Left = 7305 + TabIndex = 9 + Top = 2280 Width = 90 End Begin VB.Label lblRightL @@ -408,9 +331,9 @@ Begin VB.Form FormLevels Caption = "2" ForeColor = &H00800000& Height = 195 - Left = 1545 - TabIndex = 10 - Top = 4200 + Left = 7305 + TabIndex = 8 + Top = 2520 Width = 90 End End @@ -465,11 +388,7 @@ Private Sub cmdOK_Click() End Sub Private Sub Form_Activate() - - 'Draw preview images to the top picture boxes - DrawPreviewImage picPreview - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect - + 'Set the default midtone scrollbar ratio to 1/2 midRatio = 0.5 @@ -479,6 +398,9 @@ Private Sub Form_Activate() 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Draw a preview image + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview + End Sub 'This will reset the scrollbars to default levels @@ -514,19 +436,19 @@ End Sub '********************************************************************************* Private Sub hsInL_Change() FixScrollBars - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsInL_Scroll() FixScrollBars - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsInM_Change() If iRefresh = True Then midRatio = (CDbl(hsInM.Value) - CDbl(hsInL.Value)) / (CDbl(hsInR.Value) - CDbl(hsInL.Value)) FixScrollBars True - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End If End Sub @@ -534,39 +456,39 @@ Private Sub hsInM_Scroll() If iRefresh = True Then midRatio = (CDbl(hsInM.Value) - CDbl(hsInL.Value)) / (CDbl(hsInR.Value) - CDbl(hsInL.Value)) FixScrollBars True - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End If End Sub Private Sub hsInR_Change() FixScrollBars - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsInR_Scroll() FixScrollBars - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsOutL_Change() - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsOutL_Scroll() - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsOutR_Change() - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub Private Sub hsOutR_Scroll() - MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, picEffect + MapImageLevels hsInL.Value, hsInM.Value, hsInR.Value, hsOutL.Value, hsOutR.Value, True, fxPreview End Sub 'Draw an image based on user-adjusted input and output levels -Public Sub MapImageLevels(ByVal inLLimit As Long, ByVal inMLimit As Long, ByVal inRLimit As Long, ByVal outLLimit As Long, ByVal outRLimit As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub MapImageLevels(ByVal inLLimit As Long, ByVal inMLimit As Long, ByVal inRLimit As Long, ByVal outLLimit As Long, ByVal outRLimit As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Mapping new image levels..." diff --git a/Forms/VBP_FormInternetImport.frm b/Forms/VBP_FormInternetImport.frm index fceed3296a..312695034d 100644 --- a/Forms/VBP_FormInternetImport.frm +++ b/Forms/VBP_FormInternetImport.frm @@ -6,7 +6,7 @@ Begin VB.Form FormInternetImport ClientHeight = 2340 ClientLeft = 45 ClientTop = 315 - ClientWidth = 9735 + ClientWidth = 10050 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -21,14 +21,14 @@ Begin VB.Form FormInternetImport MinButton = 0 'False ScaleHeight = 156 ScaleMode = 3 'Pixel - ScaleWidth = 649 + ScaleWidth = 670 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 6720 + Left = 7080 TabIndex = 0 Top = 1710 Width = 1365 @@ -37,7 +37,7 @@ Begin VB.Form FormInternetImport Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 8190 + Left = 8550 TabIndex = 1 Top = 1710 Width = 1365 @@ -58,7 +58,7 @@ Begin VB.Form FormInternetImport TabIndex = 2 Text = "http://" Top = 720 - Width = 9255 + Width = 9615 End Begin VB.Label lblCopyrightWarning Appearance = 0 'Flat @@ -70,14 +70,14 @@ Begin VB.Form FormInternetImport Left = 240 TabIndex = 4 Top = 1755 - Width = 6375 + Width = 6735 End Begin VB.Label lblBackground Height = 855 Left = 0 TabIndex = 5 Top = 1560 - Width = 9735 + Width = 10095 End Begin VB.Label lblDownloadPath AutoSize = -1 'True diff --git a/Forms/VBP_FormInternetImport.frx b/Forms/VBP_FormInternetImport.frx index a64f1ada04c4678379a5785f2a659c8085cd0f6d..ee535e8f16dae6a8df999d4fb48f907f90617d36 100644 GIT binary patch delta 12 TcmZ3(xRQ}^=|slfi4&y(8{`C9 delta 15 WcmZ3 0 Then theta = theta ^ pinchAmount 'Modify the source coordinates based on the calculated theta value nX = nX * theta @@ -522,16 +518,16 @@ Public Sub PinchImage(ByVal pinchAmount As Double, ByVal whirlAngle As Double, B End Sub Private Sub Form_Activate() - - 'Create the preview - updatePreview - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me 'Mark scroll bar changes as coming from the user userChange = True + 'Create the preview + updatePreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -612,9 +608,9 @@ End Sub Private Sub updatePreview() If OptInterpolate(0) Then - PinchImage CDbl(hsAmount / 100), CDbl(hsAngle / 10), hsRadius.Value, True, True, picPreview + PinchImage CDbl(hsAmount / 100), CDbl(hsAngle / 10), hsRadius.Value, True, True, fxPreview Else - PinchImage CDbl(hsAmount / 100), CDbl(hsAngle / 10), hsRadius.Value, False, True, picPreview + PinchImage CDbl(hsAmount / 100), CDbl(hsAngle / 10), hsRadius.Value, False, True, fxPreview End If End Sub diff --git a/Forms/VBP_FormPosterize.frm b/Forms/VBP_FormPosterize.frm index 6ad5baf244..9ddc4e6b80 100644 --- a/Forms/VBP_FormPosterize.frm +++ b/Forms/VBP_FormPosterize.frm @@ -3,10 +3,10 @@ Begin VB.Form FormPosterize BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Posterize" - ClientHeight = 5460 + ClientHeight = 6540 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 11970 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,82 +19,36 @@ Begin VB.Form FormPosterize LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 364 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 798 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9000 TabIndex = 0 - Top = 4830 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10470 TabIndex = 1 - Top = 4830 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsBits Height = 255 - Left = 360 + Left = 6120 Max = 7 Min = 1 TabIndex = 3 - Top = 3840 + Top = 2520 Value = 2 Width = 4815 End @@ -111,59 +65,28 @@ Begin VB.Form FormPosterize EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 1 TabIndex = 2 Text = "2" - Top = 3780 + Top = 2460 Width = 615 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 6 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 9 - Top = 4680 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 7 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 5 + Top = 5760 + Width = 12015 End Begin VB.Label lblBits Appearance = 0 'Flat @@ -182,9 +105,9 @@ Begin VB.Form FormPosterize EndProperty ForeColor = &H00404040& Height = 405 - Left = 240 + Left = 6000 TabIndex = 4 - Top = 3480 + Top = 2160 Width = 2880 End End @@ -224,7 +147,7 @@ Private Sub cmdOK_Click() End Sub 'Subroutine for reducing the representative bits in an image -Public Sub PosterizeImage(ByVal NumOfBits As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub PosterizeImage(ByVal NumOfBits As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Posterizing image..." @@ -289,14 +212,13 @@ Public Sub PosterizeImage(ByVal NumOfBits As Byte, Optional ByVal toPreview As B End Sub Private Sub Form_Activate() - - 'Create the previews - DrawPreviewImage picPreview - PosterizeImage hsBits.Value, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Create a preview + PosterizeImage hsBits.Value, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -306,12 +228,12 @@ End Sub 'The following routines are for keeping the text box and scroll bar values in lock-step Private Sub hsBits_Change() copyToTextBoxI txtBits, hsBits.Value - PosterizeImage hsBits.Value, True, picEffect + PosterizeImage hsBits.Value, True, fxPreview End Sub Private Sub hsBits_Scroll() copyToTextBoxI txtBits, hsBits.Value - PosterizeImage hsBits.Value, True, picEffect + PosterizeImage hsBits.Value, True, fxPreview End Sub Private Sub txtBits_KeyUp(KeyCode As Integer, Shift As Integer) diff --git a/Forms/VBP_FormPrint.frm b/Forms/VBP_FormPrint.frm index 074bd44db0..c0fabd6012 100644 --- a/Forms/VBP_FormPrint.frm +++ b/Forms/VBP_FormPrint.frm @@ -141,7 +141,7 @@ Begin VB.Form FormPrint TabIndex = 7 Top = 2760 Value = 1 'Checked - Width = 1455 + Width = 2055 End Begin VB.ComboBox cbOrientation ForeColor = &H00800000& diff --git a/Forms/VBP_FormRechannel.frm b/Forms/VBP_FormRechannel.frm index 2eb08b4c55..60ba76a905 100644 --- a/Forms/VBP_FormRechannel.frm +++ b/Forms/VBP_FormRechannel.frm @@ -4,10 +4,10 @@ Begin VB.Form FormRechannel BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Rechannel" - ClientHeight = 6780 + ClientHeight = 6540 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 12000 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,27 +20,27 @@ Begin VB.Form FormRechannel LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 452 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 800 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9000 TabIndex = 0 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10470 TabIndex = 1 - Top = 6150 + Top = 5910 Width = 1365 End Begin VB.OptionButton OptChannel @@ -59,9 +59,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 9 - Left = 4440 + Left = 10200 TabIndex = 10 - Top = 5280 + Top = 3600 Width = 1695 End Begin VB.OptionButton OptChannel @@ -80,9 +80,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 8 - Left = 4440 + Left = 8880 TabIndex = 9 - Top = 4800 + Top = 3600 Width = 1695 End Begin VB.OptionButton OptChannel @@ -101,9 +101,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 7 - Left = 4440 + Left = 7320 TabIndex = 8 - Top = 4320 + Top = 3600 Width = 1695 End Begin VB.OptionButton OptChannel @@ -122,9 +122,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 6 - Left = 4440 + Left = 6120 TabIndex = 7 - Top = 3840 + Top = 3600 Width = 1695 End Begin VB.OptionButton OptChannel @@ -143,9 +143,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 5 - Left = 2280 + Left = 8880 TabIndex = 6 - Top = 4800 + Top = 2640 Width = 1815 End Begin VB.OptionButton OptChannel @@ -164,9 +164,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 4 - Left = 2280 + Left = 7320 TabIndex = 5 - Top = 4320 + Top = 2640 Width = 1695 End Begin VB.OptionButton OptChannel @@ -185,9 +185,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 3 - Left = 2280 + Left = 6120 TabIndex = 4 - Top = 3840 + Top = 2640 Width = 1695 End Begin VB.OptionButton OptChannel @@ -206,9 +206,9 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 2 - Left = 240 + Left = 8760 TabIndex = 3 - Top = 4800 + Top = 1680 Width = 1455 End Begin VB.OptionButton OptChannel @@ -227,57 +227,11 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 1 - Left = 240 + Left = 7320 TabIndex = 2 - Top = 4320 + Top = 1680 Width = 1455 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 13 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 12 - Top = 120 - Width = 2895 - End Begin VB.OptionButton OptChannel Appearance = 0 'Flat BackColor = &H80000005& @@ -294,18 +248,27 @@ Begin VB.Form FormRechannel ForeColor = &H00404040& Height = 360 Index = 0 - Left = 240 + Left = 6120 TabIndex = 11 - Top = 3840 + Top = 1680 Value = -1 'True Width = 1455 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 16 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 19 - Top = 6000 - Width = 7095 + Left = 0 + TabIndex = 15 + Top = 5760 + Width = 12015 End Begin VB.Label lblCMYK Appearance = 0 'Flat @@ -324,9 +287,9 @@ Begin VB.Form FormRechannel EndProperty ForeColor = &H00404040& Height = 285 - Left = 4320 - TabIndex = 18 - Top = 3360 + Left = 6000 + TabIndex = 14 + Top = 3240 Width = 1695 End Begin VB.Label lblCMY @@ -346,9 +309,9 @@ Begin VB.Form FormRechannel EndProperty ForeColor = &H00404040& Height = 285 - Left = 2160 - TabIndex = 17 - Top = 3360 + Left = 6000 + TabIndex = 13 + Top = 2280 Width = 1560 End Begin VB.Label lblRGB @@ -368,51 +331,11 @@ Begin VB.Form FormRechannel EndProperty ForeColor = &H00404040& Height = 285 - Left = 120 - TabIndex = 16 - Top = 3360 + Left = 6000 + TabIndex = 12 + Top = 1320 Width = 1530 End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 15 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 14 - Top = 2880 - Width = 480 - End End Attribute VB_Name = "FormRechannel" Attribute VB_GlobalNameSpace = False @@ -461,19 +384,18 @@ Private Sub cmdOK_Click() End Sub Private Sub Form_Activate() - - 'Create the image previews - DrawPreviewImage picPreview - RechannelImage 0, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview + RechannelImage 0, True, fxPreview + End Sub 'Rechannel an image (red, green, blue, cyan, magenta, yellow) -Public Sub RechannelImage(ByVal rType As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub RechannelImage(ByVal rType As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) 'Based on the channel the user has selected, display a user-friendly description of this filter Dim cName As String @@ -621,5 +543,5 @@ Private Sub Form_Unload(Cancel As Integer) End Sub Private Sub optChannel_Click(Index As Integer) - RechannelImage Index, True, picEffect + RechannelImage Index, True, fxPreview End Sub diff --git a/Forms/VBP_FormReduceColors.frm b/Forms/VBP_FormReduceColors.frm index b88dc9e8b4..5199553da5 100644 --- a/Forms/VBP_FormReduceColors.frm +++ b/Forms/VBP_FormReduceColors.frm @@ -3,10 +3,10 @@ Begin VB.Form FormReduceColors BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Reduce Image Colors" - ClientHeight = 8460 + ClientHeight = 6525 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6480 + ClientWidth = 12315 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,84 +19,56 @@ Begin VB.Form FormReduceColors LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 564 + ScaleHeight = 435 ScaleMode = 3 'Pixel - ScaleWidth = 432 + ScaleWidth = 821 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3480 + Left = 9360 TabIndex = 0 - Top = 7830 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4950 + Left = 10830 TabIndex = 1 - Top = 7830 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 2730 - Left = 240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 21 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 2730 - Left = 3360 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 20 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsBlue Height = 255 - Left = 2520 + Left = 8280 Max = 64 Min = 2 TabIndex = 10 - Top = 6195 + Top = 3675 Value = 6 Width = 3015 End Begin VB.HScrollBar hsGreen Height = 255 - Left = 2520 + Left = 8280 Max = 64 Min = 2 TabIndex = 8 - Top = 5805 + Top = 3285 Value = 7 Width = 3015 End Begin VB.HScrollBar hsRed Height = 255 - Left = 2520 + Left = 8280 Max = 64 Min = 2 TabIndex = 6 - Top = 5415 + Top = 2895 Value = 6 Width = 3015 End @@ -116,9 +88,9 @@ Begin VB.Form FormReduceColors ForeColor = &H00800000& Height = 255 Index = 2 - Left = 360 + Left = 6120 TabIndex = 4 - Top = 4440 + Top = 1920 Width = 3495 End Begin VB.TextBox TxtB @@ -134,11 +106,11 @@ Begin VB.Form FormReduceColors EndProperty ForeColor = &H00800000& Height = 360 - Left = 5640 + Left = 11400 MaxLength = 3 TabIndex = 9 Text = "6" - Top = 6150 + Top = 3630 Width = 615 End Begin VB.TextBox TxtG @@ -154,11 +126,11 @@ Begin VB.Form FormReduceColors EndProperty ForeColor = &H00800000& Height = 360 - Left = 5640 + Left = 11400 MaxLength = 3 TabIndex = 7 Text = "7" - Top = 5760 + Top = 3240 Width = 615 End Begin VB.TextBox TxtR @@ -174,11 +146,11 @@ Begin VB.Form FormReduceColors EndProperty ForeColor = &H00800000& Height = 360 - Left = 5640 + Left = 11400 MaxLength = 3 TabIndex = 5 Text = "6" - Top = 5370 + Top = 2850 Width = 615 End Begin VB.CheckBox chkColorDither @@ -187,9 +159,9 @@ Begin VB.Form FormReduceColors Caption = " Use error diffusion dithering" ForeColor = &H00800000& Height = 255 - Left = 840 + Left = 6600 TabIndex = 11 - Top = 7110 + Top = 4590 Value = 1 'Checked Width = 2655 End @@ -199,9 +171,9 @@ Begin VB.Form FormReduceColors Caption = " Use realistic coloring" ForeColor = &H00800000& Height = 255 - Left = 3600 + Left = 9360 TabIndex = 12 - Top = 7110 + Top = 4590 Value = 1 'Checked Width = 2535 End @@ -221,9 +193,9 @@ Begin VB.Form FormReduceColors ForeColor = &H00800000& Height = 255 Index = 0 - Left = 360 + Left = 6120 TabIndex = 2 - Top = 3720 + Top = 1200 Value = -1 'True Width = 2775 End @@ -243,70 +215,39 @@ Begin VB.Form FormReduceColors ForeColor = &H00800000& Height = 255 Index = 1 - Left = 360 + Left = 6120 TabIndex = 3 - Top = 4080 + Top = 1560 Width = 4095 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 21 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -600 - TabIndex = 24 - Top = 7680 - Width = 7095 + Left = 0 + TabIndex = 20 + Top = 5760 + Width = 12375 End Begin VB.Label lblWarning BackStyle = 0 'Transparent Caption = "Note: some options on this page have been disabled because the FreeImage plugin could not be found." ForeColor = &H000000C0& Height = 1095 - Left = 4470 + Left = 10230 TabIndex = 19 - Top = 3600 + Top = 1080 Visible = 0 'False Width = 1815 WordWrap = -1 'True End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3480 - TabIndex = 23 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 360 - TabIndex = 22 - Top = 2880 - Width = 480 - End Begin VB.Label lblOptions Appearance = 0 'Flat AutoSize = -1 'True @@ -324,9 +265,9 @@ Begin VB.Form FormReduceColors EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 18 - Top = 5040 + Top = 2520 Width = 3300 End Begin VB.Label lblBlue @@ -334,9 +275,9 @@ Begin VB.Form FormReduceColors Caption = "Possible blue values (2-64):" ForeColor = &H00400000& Height = 255 - Left = 360 + Left = 6120 TabIndex = 17 - Top = 6225 + Top = 3705 Width = 2175 End Begin VB.Label lblGreen @@ -344,9 +285,9 @@ Begin VB.Form FormReduceColors Caption = "Possible green values (2-64):" ForeColor = &H00400000& Height = 255 - Left = 360 + Left = 6120 TabIndex = 16 - Top = 5835 + Top = 3315 Width = 2535 End Begin VB.Label lblRed @@ -354,9 +295,9 @@ Begin VB.Form FormReduceColors Caption = "Possible red values (2-64):" ForeColor = &H00400000& Height = 255 - Left = 360 + Left = 6120 TabIndex = 15 - Top = 5445 + Top = 2925 Width = 2175 End Begin VB.Label lblMaxColors @@ -365,9 +306,9 @@ Begin VB.Form FormReduceColors Caption = "These parameters allow for a maximum of 252 colors in the quantized image." ForeColor = &H00400000& Height = 195 - Left = 360 + Left = 6120 TabIndex = 14 - Top = 6675 + Top = 4155 Width = 5505 End Begin VB.Label lblQuantMethod @@ -387,9 +328,9 @@ Begin VB.Form FormReduceColors EndProperty ForeColor = &H00404040& Height = 405 - Left = 240 + Left = 6000 TabIndex = 13 - Top = 3360 + Top = 840 Width = 2265 End End @@ -499,14 +440,13 @@ Private Sub Form_Activate() OptQuant(0).Value = True DisplayManualOptions False End If - - 'Draw the previews - DrawPreviewImage picPreview - updateReductionPreview - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview + updateReductionPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -621,7 +561,7 @@ Private Sub DisplayManualOptions(ByVal toDisplay As Boolean) End Sub 'Automatic 8-bit color reduction via the FreeImage DLL. -Public Sub ReduceImageColors_Auto(ByVal qMethod As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub ReduceImageColors_Auto(ByVal qMethod As Long, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) 'If a selection is active, remove it. (This is not the most elegant solution, but we can fix it at a later date.) If pdImages(CurrentImage).selectionActive Then @@ -693,7 +633,7 @@ Public Sub ReduceImageColors_Auto(ByVal qMethod As Long, Optional ByVal toPrevie End Sub 'Bit RGB color reduction (no error diffusion) -Public Sub ReduceImageColors_BitRGB(ByVal rValue As Byte, ByVal gValue As Byte, ByVal bValue As Byte, Optional ByVal smartColors As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub ReduceImageColors_BitRGB(ByVal rValue As Byte, ByVal gValue As Byte, ByVal bValue As Byte, Optional ByVal smartColors As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Applying manual RGB modifications to image..." @@ -859,7 +799,7 @@ Public Sub ReduceImageColors_BitRGB(ByVal rValue As Byte, ByVal gValue As Byte, End Sub 'Error Diffusion dithering to x# shades of color per component -Public Sub ReduceImageColors_BitRGB_ErrorDif(ByVal rValue As Byte, ByVal gValue As Byte, ByVal bValue As Byte, Optional ByVal smartColors As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub ReduceImageColors_BitRGB_ErrorDif(ByVal rValue As Byte, ByVal gValue As Byte, ByVal bValue As Byte, Optional ByVal smartColors As Boolean = False, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Applying manual RGB modifications to image..." @@ -1094,22 +1034,22 @@ End Sub 'Use this sub to update the on-screen preview Private Sub updateReductionPreview() If OptQuant(0).Value = True Then - ReduceImageColors_Auto FIQ_WUQUANT, True, picEffect + ReduceImageColors_Auto FIQ_WUQUANT, True, fxPreview ElseIf OptQuant(1).Value = True Then - ReduceImageColors_Auto FIQ_NNQUANT, True, picEffect + ReduceImageColors_Auto FIQ_NNQUANT, True, fxPreview Else If EntryValid(TxtR, hsRed.Min, hsRed.Max, False, False) And EntryValid(TxtG, hsGreen.Min, hsGreen.Max, False, False) And EntryValid(TxtB, hsBlue.Min, hsBlue.Max, False, False) Then If chkColorDither.Value = vbUnchecked Then If chkSmartColors.Value = vbUnchecked Then - ReduceImageColors_BitRGB TxtR, TxtG, TxtB, False, True, picEffect + ReduceImageColors_BitRGB TxtR, TxtG, TxtB, False, True, fxPreview Else - ReduceImageColors_BitRGB TxtR, TxtG, TxtB, True, True, picEffect + ReduceImageColors_BitRGB TxtR, TxtG, TxtB, True, True, fxPreview End If Else If chkSmartColors.Value = vbUnchecked Then - ReduceImageColors_BitRGB_ErrorDif TxtR, TxtG, TxtB, False, True, picEffect + ReduceImageColors_BitRGB_ErrorDif TxtR, TxtG, TxtB, False, True, fxPreview Else - ReduceImageColors_BitRGB_ErrorDif TxtR, TxtG, TxtB, True, True, picEffect + ReduceImageColors_BitRGB_ErrorDif TxtR, TxtG, TxtB, True, True, fxPreview End If End If End If diff --git a/Forms/VBP_FormRipple.frm b/Forms/VBP_FormRipple.frm index 54d5d632b8..9887f0b562 100644 --- a/Forms/VBP_FormRipple.frm +++ b/Forms/VBP_FormRipple.frm @@ -4,10 +4,10 @@ Begin VB.Form FormRipple BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Ripple" - ClientHeight = 10740 + ClientHeight = 6540 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 12105 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,35 +20,35 @@ Begin VB.Form FormRipple LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 716 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 807 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 10110 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 10110 + Top = 5910 Width = 1365 End Begin VB.HScrollBar hsPhase Height = 255 - Left = 360 + Left = 6120 Max = 360 - TabIndex = 16 - Top = 7680 + TabIndex = 15 + Top = 2880 Width = 4815 End Begin VB.TextBox txtPhase @@ -64,19 +64,19 @@ Begin VB.Form FormRipple EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 15 + TabIndex = 14 Text = "0" - Top = 7620 + Top = 2820 Width = 735 End Begin VB.HScrollBar hsAmplitude Height = 255 - Left = 360 + Left = 6120 Max = 100 - TabIndex = 13 - Top = 6840 + TabIndex = 12 + Top = 2040 Value = 10 Width = 4815 End @@ -93,20 +93,20 @@ Begin VB.Form FormRipple EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 12 + TabIndex = 11 Text = "10" - Top = 6780 + Top = 1980 Width = 735 End Begin VB.HScrollBar hsWavelength Height = 255 - Left = 360 + Left = 6120 Max = 200 Min = 1 - TabIndex = 10 - Top = 6000 + TabIndex = 9 + Top = 1200 Value = 16 Width = 4815 End @@ -123,11 +123,11 @@ Begin VB.Form FormRipple EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 9 + TabIndex = 8 Text = "16" - Top = 5940 + Top = 1140 Width = 735 End Begin VB.TextBox txtRadius @@ -143,20 +143,20 @@ Begin VB.Form FormRipple EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 7 + TabIndex = 6 Text = "100" - Top = 8460 + Top = 3660 Width = 735 End Begin VB.HScrollBar hsRadius Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = 1 - TabIndex = 6 - Top = 8520 + TabIndex = 5 + Top = 3720 Value = 100 Width = 4815 End @@ -176,9 +176,9 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 360 Index = 0 - Left = 360 - TabIndex = 5 - Top = 9360 + Left = 6120 + TabIndex = 4 + Top = 4560 Value = -1 'True Width = 1095 End @@ -198,31 +198,26 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 360 Index = 1 - Left = 1800 - TabIndex = 4 - Top = 9360 + Left = 7560 + TabIndex = 3 + Top = 4560 Width = 2535 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 5100 - Left = 240 - ScaleHeight = 338 - ScaleMode = 3 'Pixel - ScaleWidth = 382 - TabIndex = 2 - Top = 240 - Width = 5760 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 18 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 18 - Top = 9960 - Width = 7095 + Left = 0 + TabIndex = 17 + Top = 5760 + Width = 12135 End Begin VB.Label lblTitle AutoSize = -1 'True @@ -240,9 +235,9 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 285 Index = 4 - Left = 240 - TabIndex = 17 - Top = 7320 + Left = 6000 + TabIndex = 16 + Top = 2520 Width = 1425 End Begin VB.Label lblTitle @@ -261,9 +256,9 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 285 Index = 3 - Left = 240 - TabIndex = 14 - Top = 6480 + Left = 6000 + TabIndex = 13 + Top = 1680 Width = 3120 End Begin VB.Label lblTitle @@ -282,9 +277,9 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 285 Index = 0 - Left = 240 - TabIndex = 11 - Top = 5640 + Left = 6000 + TabIndex = 10 + Top = 840 Width = 3270 End Begin VB.Label lblTitle @@ -303,9 +298,9 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 285 Index = 1 - Left = 240 - TabIndex = 8 - Top = 8160 + Left = 6000 + TabIndex = 7 + Top = 3360 Width = 2145 End Begin VB.Label lblTitle @@ -326,9 +321,9 @@ Begin VB.Form FormRipple ForeColor = &H00404040& Height = 285 Index = 2 - Left = 240 - TabIndex = 3 - Top = 9000 + Left = 6000 + TabIndex = 2 + Top = 4200 Width = 1845 End End @@ -408,7 +403,7 @@ Private Sub cmdOK_Click() End Sub 'Apply a "water ripple" effect to an image -Public Sub RippleImage(ByVal rippleWavelength As Double, ByVal rippleAmplitude As Double, ByVal ripplePhase As Double, ByVal rippleRadius As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub RippleImage(ByVal rippleWavelength As Double, ByVal rippleAmplitude As Double, ByVal ripplePhase As Double, ByVal rippleRadius As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Simulating ripples across image surface..." @@ -567,16 +562,16 @@ Public Sub RippleImage(ByVal rippleWavelength As Double, ByVal rippleAmplitude A End Sub Private Sub Form_Activate() - - 'Create the preview - updatePreview - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me 'Mark scroll bar changes as coming from the user userChange = True + 'Create the preview + updatePreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -667,9 +662,9 @@ End Sub Private Sub updatePreview() If OptInterpolate(0) Then - RippleImage CDbl(hsWavelength), CDbl(hsAmplitude), CDbl(hsPhase), CDbl(hsRadius), True, True, picPreview + RippleImage CDbl(hsWavelength), CDbl(hsAmplitude), CDbl(hsPhase), CDbl(hsRadius), True, True, fxPreview Else - RippleImage CDbl(hsWavelength), CDbl(hsAmplitude), CDbl(hsPhase), CDbl(hsRadius), False, True, picPreview + RippleImage CDbl(hsWavelength), CDbl(hsAmplitude), CDbl(hsPhase), CDbl(hsRadius), False, True, fxPreview End If End Sub diff --git a/Forms/VBP_FormRotate.frm b/Forms/VBP_FormRotate.frm index 43d7f639b1..a6f19250cc 100644 --- a/Forms/VBP_FormRotate.frm +++ b/Forms/VBP_FormRotate.frm @@ -4,10 +4,10 @@ Begin VB.Form FormRotate BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Rotate Image" - ClientHeight = 8940 + ClientHeight = 6540 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 12105 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,27 +20,27 @@ Begin VB.Form FormRotate LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 596 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 807 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 8310 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 8310 + Top = 5910 Width = 1365 End Begin VB.OptionButton OptRotate @@ -59,9 +59,9 @@ Begin VB.Form FormRotate ForeColor = &H00404040& Height = 360 Index = 0 - Left = 360 - TabIndex = 8 - Top = 6990 + Left = 6120 + TabIndex = 7 + Top = 3270 Value = -1 'True Width = 5535 End @@ -81,9 +81,9 @@ Begin VB.Form FormRotate ForeColor = &H00404040& Height = 360 Index = 1 - Left = 360 - TabIndex = 7 - Top = 7380 + Left = 6120 + TabIndex = 6 + Top = 3660 Width = 5655 End Begin VB.TextBox txtAngle @@ -99,43 +99,38 @@ Begin VB.Form FormRotate EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 6 - TabIndex = 5 + TabIndex = 4 Text = "0.0" - Top = 6000 + Top = 2280 Width = 735 End Begin VB.HScrollBar hsAngle Height = 255 LargeChange = 10 - Left = 360 + Left = 6120 Max = 1800 Min = -1800 - TabIndex = 4 - Top = 6060 + TabIndex = 3 + Top = 2340 Width = 4815 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 5100 - Left = 240 - ScaleHeight = 338 - ScaleMode = 3 'Pixel - ScaleWidth = 382 - TabIndex = 3 - Top = 240 - Width = 5760 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 9 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 9 - Top = 8160 - Width = 7095 + Left = 0 + TabIndex = 8 + Top = 5760 + Width = 12135 End Begin VB.Label lblRotatedCanvas Appearance = 0 'Flat @@ -154,9 +149,9 @@ Begin VB.Form FormRotate EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 6 - Top = 6600 + Left = 6000 + TabIndex = 5 + Top = 2880 Width = 2340 End Begin VB.Label lblAmount @@ -176,9 +171,9 @@ Begin VB.Form FormRotate EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 2 - Top = 5640 + Top = 1920 Width = 1560 End End @@ -323,8 +318,9 @@ Public Sub RotateArbitrary(ByVal canvasResize As Long, ByVal rotationAngle As Do 'If tmpLayer.getLayerColorDepth = 32 Then tmpLayer.compositeBackgroundColor 'Finally, render the preview and erase the temporary layer to conserve memory - 'tmpLayer.renderToPictureBox picPreview - DrawPreviewImage picPreview, True, tmpLayer + DrawPreviewImage fxPreview.getPreviewPic, True, tmpLayer + fxPreview.setFXImage tmpLayer + tmpLayer.eraseLayer Set tmpLayer = Nothing @@ -359,7 +355,7 @@ Public Sub RotateArbitrary(ByVal canvasResize As Long, ByVal rotationAngle As Do Else Message "Arbitrary rotation requires the FreeImage plugin, which could not be located. Rotation canceled." - MsgBox "The FreeImage plugin is required for image rotation. Please go to Edit -> Preferences -> Updates and allow PhotoDemon to download core plugins. Then restart the program.", vbApplicationModal + vbOKOnly + vbInformation, "FreeImage plugin missing" + MsgBox "The FreeImage plugin is required for image rotation. Please go to Tools -> Options -> Updates and allow PhotoDemon to download core plugins. Then restart the program.", vbApplicationModal + vbOKOnly + vbInformation, "FreeImage plugin missing" End If End Sub @@ -370,45 +366,28 @@ Private Sub Form_Activate() ' previewing immensely (especially for large images, like 10+ megapixel photos) Set smallLayer = New pdLayer - Dim dstWidth As Single, dstHeight As Single - dstWidth = picPreview.ScaleWidth - dstHeight = picPreview.ScaleHeight - - Dim srcWidth As Single, srcHeight As Single - srcWidth = pdImages(CurrentImage).Width - srcHeight = pdImages(CurrentImage).Height - - 'Calculate the aspect ratio of this layer and the target picture box - Dim srcAspect As Single, dstAspect As Single - srcAspect = srcWidth / srcHeight - dstAspect = dstWidth / dstHeight - + 'Determine a new image size that preserves the current aspect ratio Dim dWidth As Long, dHeight As Long + convertAspectRatio pdImages(CurrentImage).Width, pdImages(CurrentImage).Height, fxPreview.getPreviewWidth, fxPreview.getPreviewHeight, dWidth, dHeight - 'Use that aspect ratio to determine a new image size - If srcAspect > dstAspect Then - dWidth = dstWidth - dHeight = CSng(srcHeight / srcWidth) * dWidth + 0.5 - Else - dHeight = dstHeight - dWidth = CSng(srcWidth / srcHeight) * dHeight + 0.5 - End If - - 'Create a new, smaller image - If (dstWidth < pdImages(CurrentImage).Width) Or (dstHeight < pdImages(CurrentImage).Height) Then + 'Create a new, smaller image at those dimensions + If (dWidth < pdImages(CurrentImage).Width) Or (dHeight < pdImages(CurrentImage).Height) Then smallLayer.createFromExistingLayer pdImages(CurrentImage).mainLayer, dWidth, dHeight, True Else smallLayer.createFromExistingLayer pdImages(CurrentImage).mainLayer End If - - 'Render a preview - updatePreview - + + 'Give the preview object a copy of this image data so it can show it to the user if requested + fxPreview.setOriginalImage smallLayer + 'Assign the system hand cursor to all relevant objects makeFormPretty Me userChange = True + 'Render a preview + updatePreview + End Sub Private Sub Form_Unload(Cancel As Integer) diff --git a/Forms/VBP_FormSolarize.frm b/Forms/VBP_FormSolarize.frm index 578f601259..065faef37a 100644 --- a/Forms/VBP_FormSolarize.frm +++ b/Forms/VBP_FormSolarize.frm @@ -3,10 +3,10 @@ Begin VB.Form FormSolarize BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Solarize" - ClientHeight = 5460 + ClientHeight = 6525 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6255 + ClientWidth = 12075 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,82 +19,36 @@ Begin VB.Form FormSolarize LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 364 + ScaleHeight = 435 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 805 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 4830 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 4830 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsThreshold Height = 255 - Left = 360 + Left = 6120 Max = 254 Min = 1 TabIndex = 3 - Top = 3840 + Top = 2520 Value = 127 Width = 4935 End @@ -111,59 +65,28 @@ Begin VB.Form FormSolarize EndProperty ForeColor = &H00800000& Height = 360 - Left = 5400 + Left = 11160 MaxLength = 3 TabIndex = 2 Text = "127" - Top = 3795 + Top = 2475 Width = 615 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 6 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 9 - Top = 4680 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 7 - Top = 2880 - Width = 480 + Left = 0 + TabIndex = 5 + Top = 5760 + Width = 12135 End Begin VB.Label lblThreshold Appearance = 0 'Flat @@ -182,9 +105,9 @@ Begin VB.Form FormSolarize EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 4 - Top = 3480 + Top = 2160 Width = 1950 End End @@ -224,7 +147,7 @@ End Sub 'Subroutine for "solarizing" an image ' Inputs: solarize threshold [0,255], optional previewing information -Public Sub SolarizeImage(ByVal Threshold As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub SolarizeImage(ByVal Threshold As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Solarizing image..." @@ -284,14 +207,13 @@ Public Sub SolarizeImage(ByVal Threshold As Byte, Optional ByVal toPreview As Bo End Sub Private Sub Form_Activate() - - 'Create the previews - DrawPreviewImage picPreview - SolarizeImage hsThreshold.Value, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview + SolarizeImage hsThreshold.Value, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -301,12 +223,12 @@ End Sub 'When the horizontal scroll bar is moved, update the preview and text box to match Private Sub hsThreshold_Change() copyToTextBoxI txtThreshold, hsThreshold.Value - SolarizeImage hsThreshold.Value, True, picEffect + SolarizeImage hsThreshold.Value, True, fxPreview End Sub Private Sub hsThreshold_Scroll() copyToTextBoxI txtThreshold, hsThreshold.Value - SolarizeImage hsThreshold.Value, True, picEffect + SolarizeImage hsThreshold.Value, True, fxPreview End Sub 'When the text box is changed, update the preview and text box to match (assuming the text box value is valid) diff --git a/Forms/VBP_FormSwirl.frm b/Forms/VBP_FormSwirl.frm index c112061b0e..09136bf8ed 100644 --- a/Forms/VBP_FormSwirl.frm +++ b/Forms/VBP_FormSwirl.frm @@ -4,10 +4,10 @@ Begin VB.Form FormSwirl BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Swirl" - ClientHeight = 9180 + ClientHeight = 6540 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 12105 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,27 +20,27 @@ Begin VB.Form FormSwirl LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 612 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 807 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 8550 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 8550 + Top = 5910 Width = 1365 End Begin VB.TextBox txtRadius @@ -56,20 +56,20 @@ Begin VB.Form FormSwirl EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 10 + TabIndex = 9 Text = "100" - Top = 6780 + Top = 2820 Width = 735 End Begin VB.HScrollBar hsRadius Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = 1 - TabIndex = 9 - Top = 6840 + TabIndex = 8 + Top = 2880 Value = 100 Width = 4815 End @@ -89,9 +89,9 @@ Begin VB.Form FormSwirl ForeColor = &H00404040& Height = 360 Index = 0 - Left = 360 - TabIndex = 8 - Top = 7680 + Left = 6120 + TabIndex = 7 + Top = 3720 Value = -1 'True Width = 1095 End @@ -111,9 +111,9 @@ Begin VB.Form FormSwirl ForeColor = &H00404040& Height = 360 Index = 1 - Left = 1800 - TabIndex = 7 - Top = 7680 + Left = 7560 + TabIndex = 6 + Top = 3720 Width = 2535 End Begin VB.TextBox txtAngle @@ -129,43 +129,38 @@ Begin VB.Form FormSwirl EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 6 - TabIndex = 5 + TabIndex = 4 Text = "0.0" - Top = 6000 + Top = 2040 Width = 735 End Begin VB.HScrollBar hsAngle Height = 255 LargeChange = 10 - Left = 360 + Left = 6120 Max = 1800 Min = -1800 - TabIndex = 4 - Top = 6060 + TabIndex = 3 + Top = 2100 Width = 4815 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 5100 - Left = 240 - ScaleHeight = 338 - ScaleMode = 3 'Pixel - ScaleWidth = 382 - TabIndex = 3 - Top = 240 - Width = 5760 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 12 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 12 - Top = 8400 - Width = 7095 + Left = 0 + TabIndex = 11 + Top = 5760 + Width = 12135 End Begin VB.Label lblHeight AutoSize = -1 'True @@ -182,9 +177,9 @@ Begin VB.Form FormSwirl EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 11 - Top = 6480 + Left = 6000 + TabIndex = 10 + Top = 2520 Width = 2145 End Begin VB.Label lblInterpolation @@ -204,9 +199,9 @@ Begin VB.Form FormSwirl EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 - TabIndex = 6 - Top = 7320 + Left = 6000 + TabIndex = 5 + Top = 3360 Width = 1845 End Begin VB.Label lblAmount @@ -226,9 +221,9 @@ Begin VB.Form FormSwirl EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 2 - Top = 5640 + Top = 1680 Width = 1230 End End @@ -294,7 +289,7 @@ Private Sub cmdOK_Click() End Sub 'Apply a "swirl" effect to an image -Public Sub SwirlImage(ByVal swirlAngle As Double, ByVal swirlRadius As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub SwirlImage(ByVal swirlAngle As Double, ByVal swirlRadius As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) 'Reverse the rotationAngle value so that POSITIVE values indicate CLOCKWISE rotation. swirlAngle = -(swirlAngle / 10) @@ -445,16 +440,16 @@ Public Sub SwirlImage(ByVal swirlAngle As Double, ByVal swirlRadius As Double, B End Sub Private Sub Form_Activate() - - 'Create the preview - updatePreview - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me 'Mark scroll bar changes as coming from the user userChange = True + 'Create the preview + updatePreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -516,9 +511,9 @@ End Sub Private Sub updatePreview() If OptInterpolate(0) Then - SwirlImage CDbl(hsAngle / 10), hsRadius.Value, True, True, picPreview + SwirlImage CDbl(hsAngle / 10), hsRadius.Value, True, True, fxPreview Else - SwirlImage CDbl(hsAngle / 10), hsRadius.Value, False, True, picPreview + SwirlImage CDbl(hsAngle / 10), hsRadius.Value, False, True, fxPreview End If End Sub diff --git a/Forms/VBP_FormTile.frm b/Forms/VBP_FormTile.frm index a7ecf8808f..13b093d023 100644 --- a/Forms/VBP_FormTile.frm +++ b/Forms/VBP_FormTile.frm @@ -4,10 +4,10 @@ Begin VB.Form FormTile BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Tile Image" - ClientHeight = 8685 + ClientHeight = 6525 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 11595 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,43 +20,29 @@ Begin VB.Form FormTile LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 579 + ScaleHeight = 435 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 773 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 8640 TabIndex = 0 - Top = 8070 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10110 TabIndex = 1 - Top = 8070 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 5100 - Left = 240 - ScaleHeight = 338 - ScaleMode = 3 'Pixel - ScaleWidth = 382 - TabIndex = 12 - Top = 240 - Width = 5760 - End Begin VB.TextBox TxtWidth Alignment = 2 'Center BeginProperty Font @@ -70,10 +56,10 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00800000& Height = 360 - Left = 1200 + Left = 6720 TabIndex = 7 Text = "N/A" - Top = 6660 + Top = 2940 Width = 855 End Begin VB.TextBox TxtHeight @@ -89,31 +75,31 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00800000& Height = 360 - Left = 4080 + Left = 9600 TabIndex = 6 Text = "N/A" - Top = 6660 + Top = 2940 Width = 855 End Begin VB.VScrollBar VSWidth Height = 420 - Left = 2070 + Left = 7590 Max = 32766 Min = 1 TabIndex = 5 TabStop = 0 'False - Top = 6600 + Top = 2880 Value = 15000 Width = 270 End Begin VB.VScrollBar VSHeight Height = 420 - Left = 4950 + Left = 10470 Max = 32766 Min = 1 TabIndex = 4 TabStop = 0 'False - Top = 6600 + Top = 2880 Value = 15000 Width = 270 End @@ -130,12 +116,21 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00800000& Height = 360 - Left = 720 + Left = 6240 Style = 2 'Dropdown List TabIndex = 3 - Top = 6000 + Top = 2280 Width = 3375 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 14 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground BeginProperty Font Name = "MS Sans Serif" @@ -147,13 +142,12 @@ Begin VB.Form FormTile Strikethrough = 0 'False EndProperty Height = 855 - Left = -840 - TabIndex = 14 - Top = 7920 - Width = 7095 + Left = 0 + TabIndex = 13 + Top = 5760 + Width = 11655 End Begin VB.Label lblDescription - Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent @@ -169,10 +163,10 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00404040& Height = 435 - Left = 120 - TabIndex = 13 - Top = 7260 - Width = 5955 + Left = 6000 + TabIndex = 12 + Top = 3720 + Width = 5355 End Begin VB.Label lblWidth AutoSize = -1 'True @@ -189,9 +183,9 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00400000& Height = 210 - Left = 480 + Left = 6000 TabIndex = 11 - Top = 6705 + Top = 2985 Width = 525 End Begin VB.Label lblHeight @@ -209,9 +203,9 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00400000& Height = 210 - Left = 3360 + Left = 8880 TabIndex = 10 - Top = 6705 + Top = 2985 Width = 585 End Begin VB.Label lblWidthType @@ -228,9 +222,9 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00400000& Height = 255 - Left = 2490 + Left = 8010 TabIndex = 9 - Top = 6705 + Top = 2985 Width = 855 End Begin VB.Label lblHeightType @@ -247,9 +241,9 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00400000& Height = 255 - Left = 5370 + Left = 10890 TabIndex = 8 - Top = 6705 + Top = 2985 Width = 855 End Begin VB.Label lblAmount @@ -269,9 +263,9 @@ Begin VB.Form FormTile EndProperty ForeColor = &H00404040& Height = 405 - Left = 480 + Left = 6000 TabIndex = 2 - Top = 5640 + Top = 1920 Width = 2670 End End @@ -419,7 +413,7 @@ End Sub ' 2 - custom size, as number of tiles ' The other two parameters are width and height, or tiles in x and y direction Public Sub GenerateTile(ByVal tType As Byte, Optional xTarget As Long, Optional yTarget As Long, Optional ByVal isPreview As Boolean = False) - + 'If a selection is active, remove it. (This is not the most elegant solution, but we can fix it at a later date.) If pdImages(CurrentImage).selectionActive Then pdImages(CurrentImage).selectionActive = False @@ -482,7 +476,7 @@ Public Sub GenerateTile(ByVal tType As Byte, Optional xTarget As Long, Optional If isPreview = False Then SetProgBarVal x Next x - If isPreview = False Then + If Not isPreview Then SetProgBarVal xLoop @@ -507,7 +501,9 @@ Public Sub GenerateTile(ByVal tType As Byte, Optional xTarget As Long, Optional Else 'Render the preview and erase the temporary layer to conserve memory - tmpLayer.renderToPictureBox picPreview + tmpLayer.renderToPictureBox fxPreview.getPreviewPic + fxPreview.setFXImage tmpLayer + tmpLayer.eraseLayer Set tmpLayer = Nothing @@ -524,6 +520,9 @@ Private Sub Form_Activate() cboTarget.ListIndex = 0 DoEvents + 'Give the preview object a copy of this image data so it can show it to the user if requested + fxPreview.setOriginalImage pdImages(CurrentImage).mainLayer + 'Render a preview redrawPreview = True GenerateTile cboTarget.ListIndex, TxtWidth, TxtHeight, True diff --git a/Forms/VBP_FormTwins.frm b/Forms/VBP_FormTwins.frm index 099b11480e..f4b3649501 100644 --- a/Forms/VBP_FormTwins.frm +++ b/Forms/VBP_FormTwins.frm @@ -4,10 +4,10 @@ Begin VB.Form FormTwins BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Generate Twins" - ClientHeight = 5220 + ClientHeight = 6525 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 9555 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,75 +20,29 @@ Begin VB.Form FormTwins LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 348 + ScaleHeight = 435 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 637 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 6600 TabIndex = 0 - Top = 4590 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 8070 TabIndex = 1 - Top = 4590 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 4 - Top = 120 - Width = 2895 - End Begin VB.OptionButton OptVertical Appearance = 0 'Flat BackColor = &H80000005& @@ -104,9 +58,9 @@ Begin VB.Form FormTwins EndProperty ForeColor = &H00404040& Height = 255 - Left = 3240 + Left = 7920 TabIndex = 3 - Top = 3600 + Top = 2640 Width = 2175 End Begin VB.OptionButton OptHorizontal @@ -124,67 +78,56 @@ Begin VB.Form FormTwins EndProperty ForeColor = &H00404040& Height = 255 - Left = 1560 + Left = 6240 TabIndex = 2 - Top = 3600 + Top = 2640 Value = -1 'True Width = 1575 End - Begin VB.Label lblBackground - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 855 - Left = -840 - TabIndex = 8 - Top = 4440 - Width = 7095 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 5 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End - Begin VB.Label lblAfter + Begin VB.Label lblAlgorithm AutoSize = -1 'True BackStyle = 0 'Transparent - Caption = "after" + Caption = "twin orientation:" BeginProperty Font Name = "Tahoma" - Size = 8.25 + Size = 12 Charset = 0 Weight = 400 Underline = 0 'False - Italic = -1 'True + Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 7 - Top = 2880 - Width = 360 + Height = 285 + Left = 6000 + TabIndex = 6 + Top = 2160 + Width = 1755 End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" + Begin VB.Label lblBackground BeginProperty Font - Name = "Tahoma" + Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False - Italic = -1 'True + Italic = 0 'False Strikethrough = 0 'False EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 6 - Top = 2880 - Width = 480 + Height = 855 + Left = 0 + TabIndex = 4 + Top = 5760 + Width = 11295 End End Attribute VB_Name = "FormTwins" @@ -222,7 +165,7 @@ Private Sub cmdOK_Click() End Sub 'This routine mirrors and alphablends an image, making it "tilable" or symmetrical -Public Sub GenerateTwins(ByVal tType As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub GenerateTwins(ByVal tType As Byte, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Generating image twin..." @@ -321,14 +264,13 @@ Public Sub GenerateTwins(ByVal tType As Byte, Optional ByVal toPreview As Boolea End Sub Private Sub Form_Activate() - - 'Create the image previews - DrawPreviewImage picPreview - GenerateTwins 1, True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render an image preview + GenerateTwins 1, True, fxPreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -336,9 +278,9 @@ Private Sub Form_Unload(Cancel As Integer) End Sub Private Sub OptHorizontal_Click() - GenerateTwins 1, True, picEffect + GenerateTwins 1, True, fxPreview End Sub Private Sub OptVertical_Click() - GenerateTwins 0, True, picEffect + GenerateTwins 0, True, fxPreview End Sub diff --git a/Forms/VBP_FormWaves.frm b/Forms/VBP_FormWaves.frm index 5c33c38d33..4f45e8a504 100644 --- a/Forms/VBP_FormWaves.frm +++ b/Forms/VBP_FormWaves.frm @@ -4,10 +4,10 @@ Begin VB.Form FormWaves BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " Waves" - ClientHeight = 10860 + ClientHeight = 6540 ClientLeft = -15 ClientTop = 225 - ClientWidth = 6255 + ClientWidth = 12090 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -20,27 +20,27 @@ Begin VB.Form FormWaves LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 724 + ScaleHeight = 436 ScaleMode = 3 'Pixel - ScaleWidth = 417 + ScaleWidth = 806 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3240 + Left = 9120 TabIndex = 0 - Top = 10230 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4710 + Left = 10590 TabIndex = 1 - Top = 10230 + Top = 5910 Width = 1365 End Begin VB.TextBox txtWavelengthY @@ -56,20 +56,20 @@ Begin VB.Form FormWaves EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 15 + TabIndex = 14 Text = "1" - Top = 7620 + Top = 2940 Width = 735 End Begin VB.HScrollBar hsWavelengthY Height = 255 - Left = 360 + Left = 6120 Max = 50 Min = 1 - TabIndex = 14 - Top = 7680 + TabIndex = 13 + Top = 3000 Value = 1 Width = 4815 End @@ -86,27 +86,27 @@ Begin VB.Form FormWaves EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 13 + TabIndex = 12 Text = "0" - Top = 8460 + Top = 3780 Width = 735 End Begin VB.HScrollBar hsAmplitudeY Height = 255 - Left = 360 + Left = 6120 Max = 200 - TabIndex = 12 - Top = 8520 + TabIndex = 11 + Top = 3840 Width = 4815 End Begin VB.HScrollBar hsAmplitudeX Height = 255 - Left = 360 + Left = 6120 Max = 200 - TabIndex = 10 - Top = 6840 + TabIndex = 9 + Top = 2160 Value = 20 Width = 4815 End @@ -123,20 +123,20 @@ Begin VB.Form FormWaves EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 9 + TabIndex = 8 Text = "20" - Top = 6780 + Top = 2100 Width = 735 End Begin VB.HScrollBar hsWavelengthX Height = 255 - Left = 360 + Left = 6120 Max = 50 Min = 1 - TabIndex = 7 - Top = 6000 + TabIndex = 6 + Top = 1320 Value = 30 Width = 4815 End @@ -153,11 +153,11 @@ Begin VB.Form FormWaves EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 MaxLength = 3 - TabIndex = 6 + TabIndex = 5 Text = "30" - Top = 5940 + Top = 1260 Width = 735 End Begin VB.OptionButton OptInterpolate @@ -176,9 +176,9 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 360 Index = 0 - Left = 360 - TabIndex = 5 - Top = 9360 + Left = 6120 + TabIndex = 4 + Top = 4680 Value = -1 'True Width = 1095 End @@ -198,31 +198,26 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 360 Index = 1 - Left = 1800 - TabIndex = 4 - Top = 9360 + Left = 7560 + TabIndex = 3 + Top = 4680 Width = 2535 End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - ForeColor = &H80000008& - Height = 5100 - Left = 240 - ScaleHeight = 338 - ScaleMode = 3 'Pixel - ScaleWidth = 382 - TabIndex = 2 - Top = 240 - Width = 5760 + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 18 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 End Begin VB.Label lblBackground Height = 855 - Left = -840 - TabIndex = 18 - Top = 10080 - Width = 7095 + Left = 0 + TabIndex = 17 + Top = 5760 + Width = 12135 End Begin VB.Label lblTitle AutoSize = -1 'True @@ -240,9 +235,9 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 285 Index = 4 - Left = 240 - TabIndex = 17 - Top = 7320 + Left = 6000 + TabIndex = 16 + Top = 2640 Width = 2115 End Begin VB.Label lblTitle @@ -261,9 +256,9 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 285 Index = 1 - Left = 240 - TabIndex = 16 - Top = 8160 + Left = 6000 + TabIndex = 15 + Top = 3480 Width = 3090 End Begin VB.Label lblTitle @@ -282,9 +277,9 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 285 Index = 3 - Left = 240 - TabIndex = 11 - Top = 6480 + Left = 6000 + TabIndex = 10 + Top = 1800 Width = 3390 End Begin VB.Label lblTitle @@ -303,9 +298,9 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 285 Index = 0 - Left = 240 - TabIndex = 8 - Top = 5640 + Left = 6000 + TabIndex = 7 + Top = 960 Width = 2415 End Begin VB.Label lblTitle @@ -326,9 +321,9 @@ Begin VB.Form FormWaves ForeColor = &H00404040& Height = 285 Index = 2 - Left = 240 - TabIndex = 3 - Top = 9000 + Left = 6000 + TabIndex = 2 + Top = 4320 Width = 1845 End End @@ -404,7 +399,7 @@ Private Sub cmdOK_Click() End Sub 'Apply a "wave-like" effect to an image -Public Sub WaveImage(ByVal xWavelength As Double, ByVal xAmplitude As Double, ByVal yWavelength As Double, ByVal yAmplitude As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub WaveImage(ByVal xWavelength As Double, ByVal xAmplitude As Double, ByVal yWavelength As Double, ByVal yAmplitude As Double, ByVal useBilinear As Boolean, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Dipping image in virtual wave pool..." @@ -514,16 +509,16 @@ Public Sub WaveImage(ByVal xWavelength As Double, ByVal xAmplitude As Double, By End Sub Private Sub Form_Activate() - - 'Create the preview - updatePreview - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me 'Mark scroll bar changes as coming from the user userChange = True + 'Create the preview + updatePreview + End Sub Private Sub Form_Unload(Cancel As Integer) @@ -614,9 +609,9 @@ End Sub Private Sub updatePreview() If OptInterpolate(0) Then - WaveImage CDbl(hsWavelengthX), CDbl(hsAmplitudeX), CDbl(hsWavelengthY), CDbl(hsAmplitudeY), True, True, picPreview + WaveImage CDbl(hsWavelengthX), CDbl(hsAmplitudeX), CDbl(hsWavelengthY), CDbl(hsAmplitudeY), True, True, fxPreview Else - WaveImage CDbl(hsWavelengthX), CDbl(hsAmplitudeX), CDbl(hsWavelengthY), CDbl(hsAmplitudeY), False, True, picPreview + WaveImage CDbl(hsWavelengthX), CDbl(hsAmplitudeX), CDbl(hsWavelengthY), CDbl(hsAmplitudeY), False, True, fxPreview End If End Sub diff --git a/Forms/VBP_FormWhiteBalance.frm b/Forms/VBP_FormWhiteBalance.frm index 8f08e84a01..388dfc6291 100644 --- a/Forms/VBP_FormWhiteBalance.frm +++ b/Forms/VBP_FormWhiteBalance.frm @@ -3,10 +3,10 @@ Begin VB.Form FormWhiteBalance BackColor = &H80000005& BorderStyle = 4 'Fixed ToolWindow Caption = " White Balance" - ClientHeight = 5460 + ClientHeight = 6510 ClientLeft = 45 ClientTop = 285 - ClientWidth = 6270 + ClientWidth = 12120 BeginProperty Font Name = "Tahoma" Size = 8.25 @@ -19,84 +19,36 @@ Begin VB.Form FormWhiteBalance LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 364 + ScaleHeight = 434 ScaleMode = 3 'Pixel - ScaleWidth = 418 + ScaleWidth = 808 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.CommandButton CmdOK Caption = "&OK" Default = -1 'True Height = 495 - Left = 3300 + Left = 9180 TabIndex = 0 - Top = 4830 + Top = 5910 Width = 1365 End Begin VB.CommandButton CmdCancel Cancel = -1 'True Caption = "&Cancel" Height = 495 - Left = 4770 + Left = 10650 TabIndex = 1 - Top = 4830 + Top = 5910 Width = 1365 End - Begin VB.PictureBox picEffect - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 3240 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 6 - TabStop = 0 'False - Top = 120 - Width = 2895 - End - Begin VB.PictureBox picPreview - Appearance = 0 'Flat - AutoRedraw = -1 'True - BackColor = &H80000005& - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H80000008& - Height = 2730 - Left = 120 - ScaleHeight = 180 - ScaleMode = 3 'Pixel - ScaleWidth = 191 - TabIndex = 5 - TabStop = 0 'False - Top = 120 - Width = 2895 - End Begin VB.HScrollBar hsIgnore Height = 255 - Left = 360 + Left = 6120 Max = 100 Min = 1 TabIndex = 2 - Top = 3840 + Top = 2880 Value = 5 Width = 4815 End @@ -113,58 +65,27 @@ Begin VB.Form FormWhiteBalance EndProperty ForeColor = &H00800000& Height = 360 - Left = 5280 + Left = 11040 TabIndex = 3 Text = "0.05" - Top = 3795 + Top = 2835 Width = 735 End + Begin PhotoDemon.fxPreviewCtl fxPreview + Height = 5625 + Left = 120 + TabIndex = 6 + Top = 120 + Width = 5625 + _ExtentX = 9922 + _ExtentY = 9922 + End Begin VB.Label lblBackground Height = 855 - Left = -750 - TabIndex = 9 - Top = 4680 - Width = 7095 - End - Begin VB.Label lblAfter - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "after" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 3360 - TabIndex = 8 - Top = 2880 - Width = 360 - End - Begin VB.Label lblBefore - AutoSize = -1 'True - BackStyle = 0 'Transparent - Caption = "before" - BeginProperty Font - Name = "Tahoma" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = -1 'True - Strikethrough = 0 'False - EndProperty - ForeColor = &H00404040& - Height = 195 - Left = 240 - TabIndex = 7 - Top = 2880 - Width = 480 + Left = -120 + TabIndex = 5 + Top = 5760 + Width = 12495 End Begin VB.Label lblAmount Appearance = 0 'Flat @@ -183,9 +104,9 @@ Begin VB.Form FormWhiteBalance EndProperty ForeColor = &H00404040& Height = 285 - Left = 240 + Left = 6000 TabIndex = 4 - Top = 3480 + Top = 2520 Width = 960 End End @@ -233,17 +154,17 @@ Private Sub cmdOK_Click() End Sub Private Sub Form_Activate() - - DrawPreviewImage picPreview - AutoWhiteBalance CSng(Val(txtIgnore)), True, picEffect - + 'Assign the system hand cursor to all relevant objects makeFormPretty Me + 'Render a preview + AutoWhiteBalance CSng(Val(txtIgnore)), True, fxPreview + End Sub 'Correct white balance by stretching the histogram and ignoring pixels above or below the 0.05% threshold -Public Sub AutoWhiteBalance(Optional ByVal percentIgnore As Single = 0.05, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub AutoWhiteBalance(Optional ByVal percentIgnore As Single = 0.05, Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) If toPreview = False Then Message "Preparing histogram data..." @@ -459,13 +380,13 @@ End Sub Private Sub hsIgnore_Change() txtIgnore.Text = Format(CSng(hsIgnore.Value) / 100, "0.00") txtIgnore.Refresh - AutoWhiteBalance CSng(Val(txtIgnore)), True, picEffect + AutoWhiteBalance CSng(Val(txtIgnore)), True, fxPreview End Sub Private Sub hsIgnore_Scroll() txtIgnore.Text = Format(CSng(hsIgnore.Value) / 100, "0.00") txtIgnore.Refresh - AutoWhiteBalance CSng(Val(txtIgnore)), True, picEffect + AutoWhiteBalance CSng(Val(txtIgnore)), True, fxPreview End Sub Private Sub txtIgnore_GotFocus() diff --git a/Modules/VBP_FastDrawing.bas b/Modules/VBP_FastDrawing.bas index e239c2e773..9d2e8c1cc4 100644 --- a/Modules/VBP_FastDrawing.bas +++ b/Modules/VBP_FastDrawing.bas @@ -49,22 +49,41 @@ End Type Public curLayerValues As FilterInfo +'This function can be used to populate a valid SAFEARRAY2D structure against any layer +Public Sub prepSafeArray(ByRef srcSA As SAFEARRAY2D, ByRef srcLayer As pdLayer) + + 'Populate a relevant SafeArray variable for the supplied layer + With srcSA + .cbElements = 1 + .cDims = 2 + .Bounds(0).lBound = 0 + .Bounds(0).cElements = srcLayer.getLayerHeight + .Bounds(1).lBound = 0 + .Bounds(1).cElements = srcLayer.getLayerArrayWidth + .pvData = srcLayer.getLayerDIBits + End With + +End Sub + -'prepPixelData's job is to copy the relevant layer into a temporary object, which is what individual filters and effects -' will operate on. prepPixelData() also populates the relevant SafeArray object and a host of other variables, which +'prepImageData's job is to copy the relevant layer into a temporary object, which is what individual filters and effects +' will operate on. prepImageData() also populates the relevant SafeArray object and a host of other variables, which ' filters and effects can then copy locally to ensure the fastest possible runtime speed. ' -'If the filter will be rendering a preview only, it can specify the picture box that will receive the preview effect. +'If the filter will be rendering a preview only, it can specify the fxPreview control that will receive the preview effect. ' This function will automatically adjust its parameters accordingly, and the filter routine will not have to make any ' modifications to its code. ' 'Finally, the calling routine can optionally specify a different progress bar maximum value. By default, this is the current ' layer's width, but some routines run vertically and the progress bar needs to be changed accordingly. -Public Sub prepImageData(ByRef tmpSA As SAFEARRAY2D, Optional isPreview As Boolean = False, Optional previewPictureBox As PictureBox, Optional newProgBarMax As Long = -1) +Public Sub prepImageData(ByRef tmpSA As SAFEARRAY2D, Optional isPreview As Boolean = False, Optional previewTarget As fxPreviewCtl, Optional newProgBarMax As Long = -1) 'Prepare our temporary layer Set workingLayer = New pdLayer + 'Prepare a reference to a picture box (only needed when previewing) + Dim previewPictureBox As PictureBox + 'If this is not a preview, simply copy the current layer without modification If isPreview = False Then @@ -81,6 +100,7 @@ Public Sub prepImageData(ByRef tmpSA As SAFEARRAY2D, Optional isPreview As Boole 'Start by calculating the aspect ratio of both the current image and the previewing picture box Dim dstWidth As Single, dstHeight As Single + Set previewPictureBox = previewTarget.getPreviewPic dstWidth = previewPictureBox.ScaleWidth dstHeight = previewPictureBox.ScaleHeight @@ -113,6 +133,9 @@ Public Sub prepImageData(ByRef tmpSA As SAFEARRAY2D, Optional isPreview As Boole workingLayer.createFromExistingLayer pdImages(CurrentImage).mainLayer, newWidth, newHeight End If + 'Give the preview object a copy of this image data so it can show it to the user if requested + If Not previewTarget.hasOriginalImage Then previewTarget.setOriginalImage workingLayer + End If 'With our temporary layer successfully created, populate the relevant SafeArray variable @@ -149,29 +172,14 @@ Public Sub prepImageData(ByRef tmpSA As SAFEARRAY2D, Optional isPreview As Boole End Sub -'This function can be used to populate a valid SAFEARRAY2D structure against any layer -Public Sub prepSafeArray(ByRef srcSA As SAFEARRAY2D, ByRef srcLayer As pdLayer) - - 'Populate a relevant SafeArray variable for the supplied layer - With srcSA - .cbElements = 1 - .cDims = 2 - .Bounds(0).lBound = 0 - .Bounds(0).cElements = srcLayer.getLayerHeight - .Bounds(1).lBound = 0 - .Bounds(1).cElements = srcLayer.getLayerArrayWidth - .pvData = srcLayer.getLayerDIBits - End With - -End Sub 'The counterpart to prepImageData, finalizeImageData copies the working layer back into its source then renders it ' to the screen. Like prepImageData(), a preview target can also be named. In this case, finalizeImageData will rely on ' the values calculated by prepImageData(), as it's presumed that preImageData will ALWAYS be called before this routine. -Public Sub finalizeImageData(Optional isPreview As Boolean = False, Optional previewPictureBox As PictureBox) +Public Sub finalizeImageData(Optional isPreview As Boolean = False, Optional previewTarget As fxPreviewCtl) 'If this is not a preview, our job is simple - get the newly processed DIB rendered to the screen. - If isPreview = False Then + If Not isPreview Then Message "Rendering image to screen..." @@ -199,7 +207,10 @@ Public Sub finalizeImageData(Optional isPreview As Boolean = False, Optional pre If workingLayer.getLayerColorDepth = 32 Then workingLayer.compositeBackgroundColor 'Allow workingLayer to paint itself to the target picture box - workingLayer.renderToPictureBox previewPictureBox + workingLayer.renderToPictureBox previewTarget.getPreviewPic + + 'Give the preview object a copy of the layer data used to generate the preview + previewTarget.setFXImage workingLayer 'workingLayer has served its purpose, so erase it from memory Set workingLayer = Nothing @@ -207,3 +218,4 @@ Public Sub finalizeImageData(Optional isPreview As Boolean = False, Optional pre End If End Sub + diff --git a/Modules/VBP_FilterModule.bas b/Modules/VBP_FilterModule.bas index 61a4bdc2ae..0be6f7c60d 100644 --- a/Modules/VBP_FilterModule.bas +++ b/Modules/VBP_FilterModule.bas @@ -21,7 +21,7 @@ Public Const CUSTOM_FILTER_VERSION_2003 = &H80000000 Public Const CUSTOM_FILTER_VERSION_2012 = &H80000001 'The omnipotent DoFilter routine - it takes whatever is in g_FM() - the "filter matrix" and applies it to the image -Public Sub DoFilter(Optional ByVal FilterType As String = "custom", Optional ByVal InvertResult As Boolean = False, Optional ByVal srcFilterFile As String = "", Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As PictureBox) +Public Sub DoFilter(Optional ByVal FilterType As String = "custom", Optional ByVal InvertResult As Boolean = False, Optional ByVal srcFilterFile As String = "", Optional ByVal toPreview As Boolean = False, Optional ByRef dstPic As fxPreviewCtl) 'If requested, load the custom filter data from a file If srcFilterFile <> "" Then diff --git a/PhotoDemon.vbp b/PhotoDemon.vbp index 2ce718a67e..75b99d8f84 100644 --- a/PhotoDemon.vbp +++ b/PhotoDemon.vbp @@ -119,6 +119,7 @@ Form=Forms\VBP_FormPinch.frm Form=Forms\VBP_FormWaves.frm Form=Forms\VBP_FormEtchGlass.frm Class=cPerlin3D; Classes\cPerlin3D.cls +UserControl=Controls\fxPreview.ctl ResFile32="Resources\PD_icons.RES" IconForm="FormMain" Startup="Sub Main" @@ -132,7 +133,7 @@ Description="PhotoDemon" CompatibleMode="0" MajorVer=5 MinorVer=3 -RevisionVer=251 +RevisionVer=257 AutoIncrementVer=1 ServerSupportFiles=0 VersionComments="©2000-2013 Tanner Helland - www.tannerhelland.com"