|
Path API Demo (BeginPath, EndPath, AbortPath)
|
Total Hit (4243) |
This is very simple demo to demonstrate how to use path API in grawing.
To learn more about path Please visit following URL
«a href='http://msdn.microsoft.com/library/en-us/gdi/paths_8acz.asp'»http://msdn.microsoft.com/library/en-us/gdi/paths_8acz.asp«/a»
«b»To implement Quick Demo, Copy/Past
....Read More |
Rating
|
|
|
|
Working with Arc API (Arc, ArcTo, AngleArc)
|
Total Hit (4940) |
In this article we will explore 3 APIs (Arc, ArcTo and AngleArc).
An arc is a portion or segment of an ellipse, meaning an arc is a non-complete ellipse. Because an arc must confirm to the shape of an ellipse, it is defined as it fits in a rectangle and can be illustrated as follows:
«BR»«P Al
....Read More |
Rating
|
|
|
How to use AnimateWindow API to animate form on Load/Unload events
|
Total Hit (7043) |
The AnimateWindow function enables you to produce special effects when showing or hiding windows. There are three types of animation: roll, slide, and alpha-blended fade.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add a new form called Form2 (Form1 is added by default)
- A
....Read More |
Rating
|
|
|
Drawing Chord using API
|
Total Hit (2458) |
«b»About Chords«/b»
A chord is a region bounded by the intersection of an ellipse and a line segment called a secant. The following illustration shows a chord drawn by using the Chord function.
When calling Chord, an application supplies the coordinates of the upper-left and lower-right corne
....Read More |
Rating
|
|
|
|
Example of rectangle APIs
|
Total Hit (2451) |
This sample code will show you how to work with basic Rectangle manipulation APIs to do some math operations with Rectangles.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add one timer control on the form1
- Add the following code in form1
«code LangId=1»Option Explicit
....Read More |
Rating
|
|
|
Working with GDI Brush Object
|
Total Hit (5279) |
A brush is a graphics tool that applications use to paint the interior of polygons, ellipses, and paths. Drawing applications use brushes to paint shapes; word processing applications use brushes to paint rules; computer-aided design (CAD) applications use brushes to paint the interiors of cross-sec
....Read More |
Rating
|
|
|
|
|
Working with Basic Filled Shapes using GDI API
|
Total Hit (5657) |
Filled shapes are geometric forms that are outlined by using the current pen and filled by using the current brush. There are five filled shapes:
«UL»«LI»Ellipse
«LI»Chord
«LI»Pie
«LI»Polygon
«LI»Rectangle «/UL»
Applications use filled shapes for a variety of tasks. Spreadsheet applicat
....Read More |
Rating
|
|
|
Rotating Image using PlgBlt API (Win 9x/ME not supported)
|
Total Hit (8276) |
- Create a standard exe project
- Place two picture box and one timer control onth form1
- Assign some image (relatively small image would do betetr) to Picture1.
- Add the following code in form1
«code LangId=1»Private Declare Function PlgBlt Lib "GDI32.dll" (ByVal hDCDest As Long, _
....Read More |
Rating
|
|
|
High quality image scaling
|
Total Hit (2734) |
Have you ever tried to use StretchBlt to resize image. Yep its easy to use with VB but if you use it without setting correct "Stretch Mode" it wont be a high quality image. To get high quality stretched image you can call SetStretchBltMode and set HALFTONE mode for highest quality image resizing. Fo
....Read More |
Rating
|
|
|
|
Using LineDDA api to control each point of line.
|
Total Hit (3246) |
This small code snippet will show you the use of LineDDA api which is very useful when you want to control each point of line. LineDDA use a callback method which gives x and y cordinates of the point to be drawn.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add one module t
....Read More |
Rating
|
|
|
|
Using GetPath and PolyDraw API to extract and draw path segments.
|
Total Hit (5471) |
GDI Paths are different than most of GDI objects. Path doesn't have handle but they always bound to device context. Path can be generated by calling BeginPath and EndPath API. Here the example how path can be generated.
«code LangId=1»BeginPath(Me.hDc)
'//....
'//Draw Lines
'//Draw Polygon
'/
....Read More |
Rating
|
|
|
clsEMF : A class to Create/Play/Save Enhanced Meta File (EMF).
|
Total Hit (6180) |
Internally, a metafile is an array of variable-length structures called metafile records. The first records in the metafile specify general information such as the resolution of the device on which the picture was created, the dimensions of the picture, and so on. The remaining records, which consti
....Read More |
Rating
|
|
|
Working with Meta Files (EMF,WMF and APM)
|
Total Hit (11917) |
A metafile is a mechanism for storing a graphics device interface (GDI) "picture"—a series of GDI functions that are used to draw an image. A metafile consists of a series of records, each representing a GDI function. When the metafile is played back, each stored function is executed using its recor
....Read More |
Rating
|
|
|
Extract and Play individual record stored in WMF/EMF file
|
Total Hit (6937) |
A metafile is a collection of structures that store a picture in a device-independent format. Device independence is the one feature that sets metafiles apart from bitmaps. Unlike a bitmap, a metafile guarantees device independence. There is a drawback to metafiles however, they are generally drawn
....Read More |
Rating
|
|
|
|
Creating a Transparent Bitmap
|
Total Hit (1453) |
Start a new project, and to the form add two controls - a single command button and a single PictureBox containing the picture to make transparent (Source), as shown in the illustration. The 'Transparent Result' in this example is displayed on the form's hdc, not in another picture or image control.
....Read More |
Rating
|
|
|
Displaying Bitmaps as Icons in Windows' Explorer View
|
Total Hit (637) |
As the Visual Basic developer designs more and more apps that utilize tiny bitmaps for toolbars and other things, it quickly becomes apparent that keeping track of exactly what each bitmap looks like is a task in itself.
|
Rating
|
|
|
Filling Polygonal Regions Using ExtFloodFill
|
Total Hit (1448) |
Here's a quickie one-form demo that shows how to use the ExtFloodFill API to construct a child's drawing canvas that can save and reload a picture.
When the left mouse is pressed, lines are drawn on the picturebox in response to a drag. When the right mouse is pressed, a random colour fills the in
....Read More |
Rating
|
|
|
Manipulating Image Brightness with SetPixelV
|
Total Hit (1228) |
Here's an interesting bit of code by Tanner Helland that takes any image assigned to a picturebox and rapidly adjusts the image brightness. As the new image is displayed, it progressively wipes overtop the old image (the demo picture shows the progress half-way across the girl). This code could be e
....Read More |
Rating
|
|
|
Obtaining Bitmap Info Without APIs
|
Total Hit (1298) |
Using binary file access, read the BITMAPFILEHEADER and BITMAPINFOHEADER structures of a file to obtain the image details.
|
Rating
|
|
|
Mimicking the PrintScreen Function Using OLE
|
Total Hit (593) |
This code makes use of the OLE standard interface in Windows95/Windows98 to copy the contents of the desktop (the screen) into a PictureBox and save it to disk. To use this code, you must assure that the Standard OLE Types Reference to file \Windows\System\OLEPRO32.DLL is included in the project's r
....Read More |
Rating
|
|
|
|
|
Calling the Windows PrintScreen Function Using keybd_event
|
Total Hit (615) |
The following code will copy the contents of the desktop (the screen) into a PictureBox or image control on a form.
Unlike the examples listed at the top of this page, this method uses the Windows API to actually PrintScreen to the clipboard first, and then retrieve that bitmap into the image con
....Read More |
Rating
|
|