Image Scaling


The StretchImage method also draws one bitmap on top of another, but instead of allowing a rectangle of the source bitmap to be selected for the draw operation, the entire source rectangle is stretched or shrunk to fit a destination rectangle.

 Bitmap snowflake = Resources.GetBitmap(Resources.BitmapResources.MFsnowflake); myBitmap.StretchImage(     10, 10,                                // destination x, y     snowflake,                             // source bitmap     200, 100,                              // width and height of destination     0xff);                                 // opacity myBitmap.Flush(); 

Irrespective of the size of the original, the snowflake will be drawn in a rectangle 200 pixels wide and 100 pixels high (Figure 7-9). The snowflake image doubled in width during the draw process.

image from book
Figure 7-9: The snowflake image stretched into a 200-pixel by 100-pixel destination region.




Embedded Programming with the Microsoft .Net Micro Framework
Embedded Programming with the Microsoft .NET Micro Framework
ISBN: 0735623651
EAN: 2147483647
Year: 2007
Pages: 118

Similar book on Amazon
Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud (Make: Projects)
Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud (Make: Projects)
Expert .NET Micro Framework (Expert's Voice in .NET)
Expert .NET Micro Framework (Expert's Voice in .NET)
Netduino Plus
Netduino Plus
Getting Started with Netduino
Getting Started with Netduino

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net