| 'This will show you how to make the dither effect... that is when you choose shut down from 'the start menu and the 'screen is shaded. 'Enter this code in the declerations section of you code. Private Declare Function GetDC& Lib "User32" (ByVal hWnd&) Private Declare Function ReleaseDC& Lib "User32" _ (ByVal hWnd&, ByVal hDC&) Private Declare Function DeleteObject& Lib "GDI32" (ByVal hObject&) Private Declare Function SelectObject& Lib "GDI32" _ (ByVal hDC&, ByVal hObject&) Private Declare Function CreatePatternBrush& Lib _ "GDI32" (ByVal hBitmap&) Private Declare Function PatBlt& Lib "GDI32" _ (ByVal hDC&, ByVal X&, ByVal Y&, ByVal nWidth&, _ ByVal nHeight&, ByVal dwRop&) 'Now make a command buton. Index ranges from 0 to 2. 'Remember, Command1 is a control array. Private Sub Command1_Click(Index%) Dither (Index) End Sub Private Sub Dither(Index) picBrush(Index).ScaleMode = 3 ' Pixel picBrush(Index).ScaleHeight = 8 picBrush(Index).ScaleWidth = 8 hBrush = CreatePatternBrush(picBrush(Index).Image) ROP = &HA000C9 DC = GetDC(0) res = SelectObject(DC, hBrush) res = PatBlt(DC, 0, 0, Screen.Width, Screen.Height, ROP) res = DeleteObject(hBrush) res = ReleaseDC(0, DC) End Sub |
The Dither Effect |
Express News India | Freelance ecommerce web development India