BLUE FADED BACKGROUND 
Author Message
 BLUE FADED BACKGROUND

I've tried it in C, I've tried it in VB, but so far I am unsuccessful.

Short of grabbing and manipulating a professional setup routine's background,
how do I get a *SMOOTH* faded blue background on a form?

You know the sort - bright blue at the top gradually fading to black at the
bottom, which redraws when you resize the window.

All my attempts so far have resulted in a horribly dithered effort, consisting
of less and less blue dots in bands down the screen.

I want smooth 256 shades. I know it's possible, but HOW?????

Any help here or via email would be gladly appreciated.

Thanks,

matt.
--

-------------------------------
BSc.Software Engineering Year 4
De Montfort University  
Leicester, UK              



Sat, 29 Aug 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

Quote:

>I've tried it in C, I've tried it in VB, but so far I am unsuccessful.

>Short of grabbing and manipulating a professional setup routine's background,
>how do I get a *SMOOTH* faded blue background on a form?

>You know the sort - bright blue at the top gradually fading to black at the
>bottom, which redraws when you resize the window.

>All my attempts so far have resulted in a horribly dithered effort, consisting
>of less and less blue dots in bands down the screen.

>I want smooth 256 shades. I know it's possible, but HOW?????

>Any help here or via email would be gladly appreciated.

Put this code in a Form_Paint event:

Const INSIDE_SOLID = 6
Const COPY_PEN = 13
Const PIXELS = 3
Dim i as Integer

DrawStyle = INSIDE_SOLID
DrawMode = COPY_PEN
DrawWidth = 2
ScaleMode = PIXELS
ScaleHeight = 256

For i = 0 To 255
 Line (0, i)-(Me.Width, i + 1), RGB(0, 0, 255 - i), B
Next i




Sat, 29 Aug 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

Quote:
>Short of grabbing and manipulating a professional setup routine's background,
>how do I get a *SMOOTH* faded blue background on a form?

Smooth... try ftp://ftp.sn.no/user/balchen/vb/source/shadform.zip

I think it looks dithered whatever you do.


--
Newbiehood is not a period of time, it's a way of life.

http://www.sn.no/~balchen/
ftp://ftp.sn.no/user/balchen/



Sat, 29 Aug 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

Quote:


>>Short of grabbing and manipulating a professional setup routine's
background,
>>how do I get a *SMOOTH* faded blue background on a form?

>Smooth... try ftp://ftp.sn.no/user/balchen/vb/source/shadform.zip

>I think it looks dithered whatever you do.

The trick to perfect smoothness is that a new palette is loaded containing
200 or so shades of blue. So then with a 256 colour device there will be no
dithering. I think this is mentioned somewhere on the MSDN disks.


Mon, 31 Aug 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

[snip]

Quote:
> This looks great, now how does one add the beveled, 3D text (like in
> installation programs) to the form and keep the correct background
> colors intact?
> --bill

Okay, thanks to all the posts and email, I have got a workable answer:

1. Create a 1x1 pixel .BMP with all the shades of blue in its palette.
   I used Paint Shop Pro to grab an area of Microsoft's Video For Windows
   Setup screen, and resized the image to 1x1 pixel.

2. Set the picture property of the form to the .BMP you have just created.
   (the .BMP is around 1080 bytes in size so this won't slow anything down).
   This alters the palette of the form to contain the shades of blue.

3. Write a bit of code that looks a bit like this:

   Sub Form_PaintBlue()
   Dim i As Integer
   Dim blueheight as Integer
     Me.ScaleMode = 3  'pixel
                 blueheight = Me.ScaleHeight \ 256
     For i = 0 To 255
       Me.Line (0,i*blueheight)-Step(Me.ScaleWidth,blueheight),RGB(0,0,255-i),BF
     Next
   End

4. To print some "3d" text, the code looks a bit like this:

   Sub Form_Print (ByVal x As Single, ByVal y As Single, ByVal text As String)

   Me.FontName = "Arial"
   Me.FontBold = True
   Me.FontSize = 24

   Me.CurrentX = x+2
   Me.CurrentY = y+2
   Me.ForeColor = &H0&  'black
   Me.Print text

   Me.CurrentX = x
   Me.CurrentY = y
   Me.ForeColor = &HFFFFF&  'yellow (i think)
   Me.Print text

         End

5. Now, in your Form_Paint you just have:

   Form_Paint
     Form_Paintblue
     Form_Print 16,16,"Here is some text"
   End

Thanks everyone who helped me. I hope this hopes those of you
who posted supplementary questions!

matt.
--

-------------------------------
BSc.Software Engineering Year 4
De Montfort University  
Leicester, UK              



Fri, 04 Sep 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

Does anyone know how to do this on an MDI?

Quote:



>>> Put this code in a Form_Paint event:
>>> Const INSIDE_SOLID = 6
>>> Const COPY_PEN = 13
>>> Const PIXELS = 3
>>> Dim i as Integer
>>> DrawStyle = INSIDE_SOLID
>>> DrawMode = COPY_PEN
>>> DrawWidth = 2
>>> ScaleMode = PIXELS
>>> ScaleHeight = 256
>>> For i = 0 To 255
>>>  Line (0, i)-(Me.Width, i + 1), RGB(0, 0, 255 - i), B
>>> Next i
>This looks great, now how does one add the beveled, 3D text (like in
>installation programs) to the form and keep the correct background
>colors intact?
>--bill

Claude


Mon, 07 Sep 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

Quote:
>Short of grabbing and manipulating a professional setup routine's background,
>how do I get a *SMOOTH* faded blue background on a form?

Get ftp://ftp.netcom.com/pub/rc/rcw/vbcode/gradient.zip.
It's two metafiles - use either one, the smaller one is 64 colors, the
larger, 256 colors. They'll draw faster than any code you can stick in
the paint event. Just put them in the form's picture property.
--

Celebrate Hannibal Day this year.  Take an elephant to lunch.


Mon, 07 Sep 1998 03:00:00 GMT  
 BLUE FADED BACKGROUND

Quote:
>Okay, thanks to all the posts and email, I have got a workable answer:

//snip//

Quote:
>Thanks everyone who helped me. I hope this hopes those of you who posted
>supplementary questions!

>matt.
>--

>-------------------------------
>BSc.Software Engineering Year 4
>De Montfort University  
>Leicester, UK

Matt,

There were several messages last year about this topic.  I put together
a benchmark with 3 different approaches.  The VB3 source code is in

http://www.win.net/netcadet/vb

the file is shade.zip

HTH

Bill Mitchell
Louisville, KY

http://www.win.net/netcadet



Fri, 11 Sep 1998 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Blue fading window

2. Fading Blue to Black

3. Fading Background!?

4. How to make faded background

5. Real Fade-in and Fade-out

6. Fade-in and Fade-out of button controls

7. Fade in and Fade out images???

8. Fade-in, Fade-out images???

9. Fade-in, Fade-out effect

10. Putting Graphics On Backgrounds without killing backgrounds.

11. How to prevent a blue highllited background of selected items within a checkbox style listbox ?

12. How to remove blue background from items within a multi-select listbox with selection box.

 

 
Powered by phpBB® Forum Software