Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips

Graphic Design

1-20 of 86     Previous     Next
How to Draw a Spiral in VB
by Richard Bunt
Using a loop and the maths formula for a spiral, you can use pset(x,y) to plot the points returned by the formulas.
Create Rollover Graphics in ASPX Pages
by David Derf
This tip shows you how to create rollover graphics in .aspx pages using the ASP.NET Hyperlink Web UI control.
GetRandomColor - Generating a random color
by Marco Bellinaso
Return a random color Example: Me.BackColor = GetRandomColor()
GetScreenSnapshot - Retrieving the current contents of the screen or the active window
by Marco Bellinaso
Return the current contents of the screen or the active window It works by simulating the typing of the Print-Screen key (and Alt key if activeWindowOnly is True), which dumps the screen to the clipboard. Example: PictureBox1.Image = GetScreenSnapshot(True)
ImageFormatUtils class - Find the ImageFormat for a filename or MIME type
by Richard Deeming
/// /// Provides static (Shared) methods to find the /// ImageFormat for a filename or MIME type. ///
Animation - A class to extract all the frames of an animated image
by Marco Bellinaso
This class loads an animated image and gives access to all its internal frames as Bitmap objects Example: load the animation and extract its frames Me.Cursor = Cursors.WaitCursor Dim anim As New Animation("D:\SampleAnimation.gif") Me.Cursor = Cursors.Default get a reference to the first ...
GetAnimationFrameCount - Retrieve the number of frames contained in the specified image
by Marco Bellinaso
Retrieve the number of frames contained in the specified image. For non-animated images the function returns 1 Example: Dim frameCount As Integer = GetAnimationFrameCount("D:\sample.gif")
GetGreyScale - Convert a color to greyscale
by Marco Bellinaso
Convert a color to greyscale Example: Me.BackColor = GetGreyScale(Color.Red)
GetGreyScaleImage - Convert a bitmap to greyscale
by Marco Bellinaso
Convert a bitmap to greyscale - the function returns a new bitmap, it does not directly modify the input image. Note: requires the GetGreyScale function Example: Dim bmp As New Bitmap("D:\sample.gif") PictureBox1.Image = GetGreyScaleImage(bmp)
GetImageFormat - Retrieve the format of the input image, according on its extension
by Marco Bellinaso
Return the format of the input image, according on its extension Example: Dim imgFormat As System.Drawing.imaging.ImageFormat = GetImageFormat("D:\sample.gif")
ResizeImage - Resize an image, and optionally keep the original ratio automatically
by Marco Bellinaso
Resize the specified image file - The new dimensions are expressed in percentage of the original size. The resized image overwrites the original file. Note: requires the GetImageFormat function Example: ResizeImage("D:\sample.gif", 50.0, 50.0) ' make the image half the original size
Print3D - Drawing a text with 3D effect
by Marco Bellinaso
Display a text with 3D effect g: a Graphics object text: the text to be displayed coords: the Point with the X and Y coordinates col: the text color fnt: the text font shadowCol: the shadow color (default is black) shadowOffsetX, shadowOffsetY: the shadow distance of shadow in pixels ...
Select Areas Within a Graphics Window
by James Menesez
Measuring a string drawn with a specific font
by Marco Bellinaso
When you're dynamically drawing text (either on a Windows Form or Web Form application), you may need to calculate the width and height of a string printed with a particular font. This is easy with the Graphics class's Measure string method, that takes in input the string being measured, and ...
Color2Html - Retrieving the HTML code for the specified Color
by Marco Bellinaso
Return the HTML code for the specified Color Example: MessageBox.Show(Color2Html(Color.Red)) ==> #ff0000
CreateEmf - creating an Enhanced Metafile (EMF) from a bitmap image
by Alessandro Del Sole
This routine demonstrates how to create an Enhanced Metafile (EMF) from a bitmap image, contained in a PictureBox. You must use a PictureBox control, since the Image control doesn't support the hDC property, needed to create the image file. Draw a PictureBox on a form, and insert a ...
DrawFlipImage - flipping an image on one or both axes
by Francesco Balena
Flip an image on one or both axes. The x and y parameters are the coordinates of the upper-left point Note: requires Imports System.Drawing.Imaging Example: Dim gr As Graphics = Me.CreateGraphics gr.Clear(Color.White) Dim bmp As New Bitmap("logo.bmp") DrawFlipImage(gr, bmp, 100, 20, ...
DrawRotateImage - rotating an image by a specified angle
by Francesco Balena
Rotate an image by a specified angle (in degrees) The x and y parameters are the coordinates of the upper-left point Note: requires Imports System.Drawing.Imaging Example: Dim gr As Graphics = Me.CreateGraphics gr.Clear(Color.White) Dim bmp As New Bitmap("logo.bmp") DrawRotateImage(gr, ...
DrawSkewImage - skewing an image by a given amount along one or both axes
by Francesco Balena
Skew an image by a given amount along one or both axes (the dx and dy parameters) The x and y parameters are the coordinates of the upper-left point Note: requires Imports System.Drawing.Imaging Example: Dim gr As Graphics = Me.CreateGraphics gr.Clear(Color.White) Dim bmp As New Bitmap("logo.
Process individual pixels of a bitmap
by Francesco Balena
While you can access individual pixels of a bitmap by means of the GetPixel and SetPixel methods of the Bitmap object, in practice you seldom want to use these methods, as they are simply too slow for most cpu-intensive operations. Fortunately there is a faster way, which consists of moving all ...
1-20 of 86     Previous     Next
Sitemap