in all the forums and I just want to say I appreciate all the help (and your humor) you have given to all of us.
Have a great weekend!
Regards, Jules

FUNCTION GetBValue?(BYVAL nColor&) EXPORT DIM F AS INTEGER ! mov AL, Byte Ptr nColor&[2] ! xor AH, AH ! mov F, AX FUNCTION = CBYT(F) END FUNCTION FUNCTION GetGValue?(BYVAL nColor&) EXPORT DIM F AS INTEGER ! mov AL, Byte Ptr nColor&[1] ! xor AH, AH ! mov F, AX FUNCTION = CBYT(F) END FUNCTION FUNCTION GetRValue?(BYVAL nColor&) EXPORT DIM F AS INTEGER ! mov AL, Byte Ptr nColor&[0] ! xor AH, AH ! mov F, AX FUNCTION = CBYT(F) END FUNCTION ' Compute the resulting RGB for the translucid pixel FUNCTION skTransRGB&(BYVAL hDC1&, BYVAL x1&, BYVAL y1&, BYVAL hDC2&, BYVAL x2&, BYVAL y2&, BYVAL Percent&) EXPORT ' Get the color of the first picture and extract the r&,g&,b& values Colr1& = GetPixel(hDC1&, x1&, y1&) r1& = GetRValue(Colr1&) b1& = GetBValue(Colr1&) g1& = GetGValue(Colr1&) ' Get the color of the second picture and extract the r&,g&,b& values Colr2& = GetPixel(hDC2&, x2&, y2&) r2& = GetRValue(Colr2&) b2& = GetBValue(Colr2&) g2& = GetGValue(Colr2&) ' Mix the colors based on the specified percent& to create a new color ' that's a perfect combination of the previous two r& = (((100 - percent&) * r1&) + (percent& * r2&)) \ 100 g& = (((100 - percent&) * g1&) + (percent& * g2&)) \ 100 b& = (((100 - percent&) * b1&) + (percent& * b2&)) \ 100 FUNCTION = RGB(r&, g&, b&) END FUNCTION
#Compile Exe #Register None #Include "Win32Api.Inc" %ID_Label1 = 101 %ID_Label2 = 102 %ID_Text1 = 201 %ID_Button = 301 Global hDlg& CallBack Function hDlg_CB() Dim BrushLtBr As Static Long, BrushWhite As Static Long, BrushBlue As Static Long Select Case CbMsg Case %WM_INITDIALOG Local Lb As LOGBRUSH Lb.lbStyle = %BS_SOLID Lb.lbColor = &H80C0FF: BrushLtBr = CreateBrushIndirect(Lb) Lb.lbColor = %White : BrushWhite = CreateBrushIndirect(Lb) Lb.lbColor = %Blue : BrushBlue = CreateBrushIndirect(Lb) Function = %TRUE Case %WM_DESTROY DeleteObject BrushLtBr DeleteObject BrushWhite DeleteObject BrushBlue Case %WM_CTLCOLORDLG ' Return the handle of the dialog background brush. Function = BrushLtBr Case %WM_CTLCOLORSTATIC, %WM_CTLCOLOREDIT Select Case GetDlgCtrlId(CbLparam) Case %ID_Text1 SetTextColor CbWparam, %Blue SetBkColor CbWparam, %White Function = BrushWhite Case %ID_Label1 SetBkMode CbWparam, %TRANSPARENT SetTextColor CbWparam, &H80 Function = BrushLtBr Case %ID_Label2 SetTextColor CbWparam, %White SetBkColor CbWparam, %Blue Function = BrushBlue Case %ID_BUTTON SetBkColor CbWparam, &H80C0FF SetTextColor CbWparam, %Blue Function = BrushLtBr End Select End Select End Function Function PbMain () Dialog New 0 ,"Test",0,0, 105, 90, %DS_CENTER Or %WS_OVERLAPPEDWINDOW To hDlg Control Add Label, hDlg, %ID_Label1, "Very important", 10, 5, 80, 10, %SS_RIGHT Control Add TextBox, hDlg, %ID_Text1,"1. Not nice" + $CRLF + "2. Colors, fonts" + $CRLF + "3. Pardon", 9, 35, 82, 30, %ES_WANTRETURN Or %ES_MULTILINE Or %ES_READONLY, %WS_EX_CLIENTEDGE Control Add Option, hDlg, %ID_Button, "Testbutton", 10, 70, 80, 15 Dialog Show Modal hDlg, Call hDlg_CB End Function
Case 1 SetBkColor CbWparam, &H80C0FF Function = BrushLtBr
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: