Click here to Skip to main content
15,929,811 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: ListBox with Icons Pin
CodingYoshi28-Nov-06 3:51
CodingYoshi28-Nov-06 3:51 
GeneralRe: ListBox with Icons Pin
MatrixCoder28-Nov-06 9:56
MatrixCoder28-Nov-06 9:56 
QuestionGive Picture a defined Shadow.. Pin
martinx23-Nov-06 9:50
martinx23-Nov-06 9:50 
AnswerRe: Give Picture a defined Shadow.. Pin
Dave Sexton23-Nov-06 19:23
Dave Sexton23-Nov-06 19:23 
GeneralRe: Give Picture a defined Shadow.. Pin
martinx23-Nov-06 19:28
martinx23-Nov-06 19:28 
AnswerRe: Give Picture a defined Shadow.. Pin
Thomas Stockwell25-Nov-06 15:45
professionalThomas Stockwell25-Nov-06 15:45 
GeneralRe: Give Picture a defined Shadow.. Pin
martinx29-Nov-06 19:28
martinx29-Nov-06 19:28 
GeneralRe: Give Picture a defined Shadow.. Pin
Thomas Stockwell30-Nov-06 10:44
professionalThomas Stockwell30-Nov-06 10:44 
This code is in C#, but I am sure that it can easily be translated. This is code that is contained in a screen saver presentation that paints 3 random images with a random quote specified in a particular directory:

public void DrawRandomImage(Graphics g, Rectangle rect)<br />
        {<br />
            if (usedIndexes.Count > currentImageIndex && bitmaps.Count >0)<br />
            {<br />
                if (showEffects)<br />
                    ControlPaint.DrawImageDisabled(g, bitmaps[usedIndexes[currentImageIndex]], rect.X + 5, rect.Y + 5, Color.Transparent);<br />
                g.DrawImage(bitmaps[usedIndexes[currentImageIndex]], rect);<br />
                currentImageIndex++;<br />
                if (currentImageIndex == 3)<br />
                    currentImageIndex = 0;<br />
            }<br />
            else<br />
                g.FillRectangle(new SolidBrush(Color.Black), rect);<br />
        }

The variable bitmaps is an array of bitmaps that were read in from a specified directory. Basically replace the entire array with one image if you so choose. The two key parts of this code is:
ControlPaint.DrawImageDisabled()
which will draw a grayscale image which then can be offsetted from the image drawn with the g.DrawImage.

If you need further explanation just ask. This explanation may seem a bit jumbled.

Regards,
Thomas Stockwell

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

Visit my homepage Oracle Studios[^]

QuestionReal Transparent Picturebox ? Pin
martinx23-Nov-06 9:45
martinx23-Nov-06 9:45 
AnswerRe: Real Transparent Picturebox ? Pin
jsampsonPC23-Nov-06 9:56
jsampsonPC23-Nov-06 9:56 
GeneralRe: Real Transparent Picturebox ? Pin
martinx23-Nov-06 19:29
martinx23-Nov-06 19:29 
GeneralRe: Real Transparent Picturebox ? Pin
jsampsonPC24-Nov-06 3:50
jsampsonPC24-Nov-06 3:50 
QuestionHow to compare files? Pin
Zenly23-Nov-06 7:44
Zenly23-Nov-06 7:44 
AnswerRe: How to compare files? Pin
Crispin Horsfield23-Nov-06 7:58
professionalCrispin Horsfield23-Nov-06 7:58 
GeneralRe: How to compare files? Pin
Zenly23-Nov-06 8:06
Zenly23-Nov-06 8:06 
AnswerRe: How to compare files? Pin
Zenly28-Nov-06 2:33
Zenly28-Nov-06 2:33 
Questionusing windows media SDK API methods Pin
jady8423-Nov-06 7:23
jady8423-Nov-06 7:23 
QuestionExecuteMode defaults back to NonQuery Pin
jskuse23-Nov-06 5:10
jskuse23-Nov-06 5:10 
QuestionQuick Help!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
dannydefreakagain23-Nov-06 4:51
dannydefreakagain23-Nov-06 4:51 
QuestionProblem with my VB setup program. Pin
dannydefreakagain23-Nov-06 4:45
dannydefreakagain23-Nov-06 4:45 
AnswerRe: Problem with my VB setup program. Pin
Johan Hakkesteegt23-Nov-06 22:15
Johan Hakkesteegt23-Nov-06 22:15 
QuestionDataAdapter - What is writen back to Server in UPDATE Pin
RichardBerry23-Nov-06 4:33
RichardBerry23-Nov-06 4:33 
AnswerRe: DataAdapter - What is writen back to Server in UPDATE Pin
jsampsonPC23-Nov-06 10:06
jsampsonPC23-Nov-06 10:06 
GeneralRe: DataAdapter - What is writen back to Server in UPDATE Pin
RichardBerry23-Nov-06 21:36
RichardBerry23-Nov-06 21:36 
GeneralRe: DataAdapter - What is writen back to Server in UPDATE Pin
jsampsonPC24-Nov-06 3:53
jsampsonPC24-Nov-06 3:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.