0% found this document useful (0 votes)
26 views52 pages

Microsoft Silverlight Edition Programming Windows Phone 7 Charles Petzold - Downloadable PDF 2025

The document is a downloadable PDF titled 'Microsoft Silverlight Edition Programming Windows Phone 7' by Charles Petzold, published in 2010. It includes comprehensive content on developing applications for Windows Phone 7 using Silverlight, covering basics, layout, graphics, and more. The document also provides links to additional recommended resources and books related to Windows Phone development.

Uploaded by

ruvjrdd383
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views52 pages

Microsoft Silverlight Edition Programming Windows Phone 7 Charles Petzold - Downloadable PDF 2025

The document is a downloadable PDF titled 'Microsoft Silverlight Edition Programming Windows Phone 7' by Charles Petzold, published in 2010. It includes comprehensive content on developing applications for Windows Phone 7 using Silverlight, covering basics, layout, graphics, and more. The document also provides links to additional recommended resources and books related to Windows Phone development.

Uploaded by

ruvjrdd383
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Microsoft Silverlight Edition Programming Windows

Phone 7 Charles Petzold - Downloadable PDF 2025

https://ebookfinal.com/download/microsoft-silverlight-edition-
programming-windows-phone-7-charles-petzold/

Visit ebookfinal.com today to download the complete set of


ebooks or textbooks
Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Beginning Windows Phone 7 Application Development Building


Windows Phone Applications Using Silverlight and XNA 1st
Edition Nick Lecrenski
https://ebookfinal.com/download/beginning-windows-phone-7-application-
development-building-windows-phone-applications-using-silverlight-and-
xna-1st-edition-nick-lecrenski/

Microsoft XNA Framework Edition Charles Petzold

https://ebookfinal.com/download/microsoft-xna-framework-edition-
charles-petzold/

Pro Windows Phone 7 Development 2nd Edition Rob Cameron

https://ebookfinal.com/download/pro-windows-phone-7-development-2nd-
edition-rob-cameron/

Windows Phone 7 in Action 1st Edition Timothy Binkley-


Jones

https://ebookfinal.com/download/windows-phone-7-in-action-1st-edition-
timothy-binkley-jones/
Using Microsoft Windows 7 1st Edition J. Peter Bruzzese

https://ebookfinal.com/download/using-microsoft-windows-7-1st-edition-
j-peter-bruzzese/

The O Leary Series Microsoft Windows 7 1st Edition Linda


O'Leary

https://ebookfinal.com/download/the-o-leary-series-microsoft-
windows-7-1st-edition-linda-oleary/

The Annotated Turing 1st Edition Charles Petzold

https://ebookfinal.com/download/the-annotated-turing-1st-edition-
charles-petzold/

Switching to Microsoft Windows 7 The Painless Way to


Upgrade from Windows XP or Vista 1st Edition Elna Tymes

https://ebookfinal.com/download/switching-to-microsoft-windows-7-the-
painless-way-to-upgrade-from-windows-xp-or-vista-1st-edition-elna-
tymes/

New Perspectives on Microsoft Windows 7 Comprehensive New


Perspectives Thomson Course Technology 1st Edition June
Jamrich Parsons
https://ebookfinal.com/download/new-perspectives-on-microsoft-
windows-7-comprehensive-new-perspectives-thomson-course-
technology-1st-edition-june-jamrich-parsons/
Microsoft Silverlight Edition Programming Windows
Phone 7 Charles Petzold Digital Instant Download
Author(s): Charles Petzold
ISBN(s): 9780735656673, 0735656673
Edition: 1
File Details: PDF, 43.07 MB
Year: 2010
Language: english
PUBLISHED BY
M crosoft Press
A D v s on of M crosoft Corporat on
One M crosoft Way
Redmond, Wash ngton 98052-6399
Copyr ght © 2010 by M crosoft Corporat on (A )
A r ghts reserved No part of the contents of th s book may be reproduced or transm tted n any form or by any
means w thout the wr tten perm ss on of the pub sher
L brary of Congress Contro Number 2010941604
ISBN 978-0-7356-5667-3

Pr nted and bound n the Un ted States of Amer ca

M crosoft Press books are ava ab e through bookse ers and d str butors wor dw de For further nformat on about
nternat ona ed t ons, contact your oca M crosoft Corporat on office or contact M crosoft Press Internat ona
d rect y at fax (425) 936-7329 Te us what you th nk of th s book at http //www m crosoft com/ earn ng/booksurvey
Send comments to msp nput@m crosoft com

M crosoft and the trademarks sted at http //www m crosoft com/about/ ega /en/us/Inte ectua Property/
Trademark/EN-US aspx are trademarks of the M crosoft group of compan es A other marks are the property
of the r respect ve owners

The examp e compan es, organ zat ons, products, doma n names, e-ma addresses, ogos, peop e, p aces, and
events dep cted here n are fict t ous No assoc at on w th any rea company, organ zat on, product, doma n name,
e-ma address, ogo, person, p ace, or event s ntended or shou d be nferred

Th s book expresses the author’s v ews and op n ons The nformat on conta ned n th s book s prov ded w thout
any express, statutory, or mp ed warrant es Ne ther the authors, M crosoft Corporat on, nor ts rese ers, or
d str butors w be he d ab e for any damages caused or a eged to be caused e ther d rect y or nd rect y by
th s book

Acquisitions Editor: Devon Musgrave


Developmental Editor: Devon Musgrave
Project Editor: Devon Musgrave
Editorial Production: Ash ey Schne der, S4Car s e Pub sh ng Serv ces
Technical Reviewer: Per B omqv st; Techn ca Rev ew Serv ces prov ded by Content Master, a member
of CM Group, Ltd
Body Part No X17-35780
Contents at a Glance
Part I The Basics
1 Hello, Windows Phone 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Getting Oriented. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3 An Introduction to Touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4 Bitmaps, Also Known as Textures . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5 Sensors and Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
6 Issues in Application Architecture . . . . . . . . . . . . . . . . . . . . . . . . 107

Part II Silverlight
7 XAML Power and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
8 Elements and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
9 The Intricacies of Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
10 The App Bar and Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11 Dependency Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
12 Data Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
13 Vector Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
14 Raster Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
15 Animations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
16 The Two Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
17 Items Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
18 Pivot and Panorama . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701

iii
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi

Part I The Basics


1 Hello, Windows Phone 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Targeting Windows Phone 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
The Hardware Chassis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Sensors and Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
File | New | Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
A First Silverlight Phone Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
The Standard Silverlight Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Color Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Points and Pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
The XAP is a ZIP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
An XNA Program for the Phone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2 Getting Oriented. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Silverlight and Dynamic Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Orientation Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
XNA Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Simple Clocks (Very Simple Clocks) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3 An Introduction to Touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Low-Level Touch Handling in XNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
The XNA Gesture Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Low-Level Touch Events in Silverlight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
The Manipulation Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Routed Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Some Odd Behavior? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

What do you think of this book? We want to hear from you!


M crosoft s nterested n hear ng your feedback so we can cont nua y mprove our
books and earn ng resources for you. To part c pate n a br ef on ne survey, p ease v s t:

microsoft.com/learning/booksurvey

v
vi Table of Contents

4 Bitmaps, Also Known as Textures . . . . . . . . . . . . . . . . . . . . . . . . . . 65


XNA Texture Drawing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
The Silverlight Image Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Images Via the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Image and ImageSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Loading Local Bitmaps from Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Capturing from the Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
The Phone’s Photo Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

5 Sensors and Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83


Accelerometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
A Simple Bubble Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Geographic Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Using a Map Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

6 Issues in Application Architecture . . . . . . . . . . . . . . . . . . . . . . . . 107


Basic Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Passing Data to Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Sharing Data Among Pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Retaining Data across Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
The Multitasking Ideal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Task Switching on the Phone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Page State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Isolated Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Xna Tombstoning and Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Testing and Experimentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

Part II Silverlight
7 XAML Power and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
A TextBlock in Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Property Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Property-Element Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Colors and Brushes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Content and Content Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
The Resources Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Sharing Brushes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
x:Key and x:Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
An Introduction to Styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Table of Contents vii

Style Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166


Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Gradient Accents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

8 Elements and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171


Basic Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Animating at the Speed of Video. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Handling Manipulation Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
The Border Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
TextBlock Properties and Inlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
More on Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Playing Movies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Modes of Opacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Non-Tiled Tile Brushes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

9 The Intricacies of Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197


The Single-Cell Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
The StackPanel Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Text Concatenation with StackPanel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Nested Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Visibility and Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Two ScrollViewer Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
The Mechanism of Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Inside the Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
A Single-Cell Grid Clone. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
A Custom Vertical StackPanel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
The Retro Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Canvas and ZIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
The Canvas and Touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
The Mighty Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

10 The App Bar and Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235


ApplicationBar Icons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Jot and Application Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Jot and Touch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Jot and the ApplicationBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Elements and Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
RangeBase and Slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
The Basic Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
The Concept of Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Theme Styles and Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
The Button Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Toggling a Stopwatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Buttons and Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
TextBox and Keyboard Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286

11 Dependency Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297


The Problem Illustrated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
The Dependency Property Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Deriving from UserControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
A New Type of Toggle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Panels with Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Attached Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

12 Data Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339


Source and Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Target and Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Binding Converters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Relative Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
The “this” Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Notification Mechanisms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
A Simple Binding Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Setting the DataContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Simple Decision Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Converters with Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Give and Take. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
TextBox Binding Updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380

13 Vector Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393


The Shapes Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Canvas and Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Overlapping and ZIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Polylines and Custom Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Caps, Joins, and Dashes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Polygon and Fill. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
The Stretch Property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Dynamic Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Table of Contents ix

The Path Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416


Geometries and Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Grouping Geometries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
The Versatile PathGeometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
The ArcSegment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
The Path Markup Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
How This Chapter Was Created . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452

14 Raster Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459


The Bitmap Class Hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
WriteableBitmap and UIElement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
The Pixel Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Vector Graphics on a Bitmap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Images and Tombstoning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Saving to the Picture Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Becoming a Photo Extras Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494

15 Animations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Frame-Based vs. Time-Based . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Animation Targets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Click and Spin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Some Variations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
XAML-Based Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
A Cautionary Tale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Key Frame Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Trigger on Loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Animating Attached Properties (or Not) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Splines and Key Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
The Bouncing Ball Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
The Easing Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Animating Perspective Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Animations and Property Precedence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569

16 The Two Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573


ContentControl and DataTemplate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Examining the Visual Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
ControlTemplate Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
The Visual State Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
x Table of Contents

Sharing and Reusing Styles and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . 603


Custom Controls in a Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Variations on the Slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
The Ever-Handy Thumb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Custom Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626

17 Items Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633


Items Controls and Visual Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
Customizing Item Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
ListBox Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
Binding to ItemsSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
Databases and Business Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
Fun with DataTemplates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
Changing the Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
The DataTemplate Bar Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
A Card File Metaphor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689

18 Pivot and Panorama . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701


Compare and Contrast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
Music by Composer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
The XNA Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
The XNA Music Classes: MediaLibrary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
Displaying the Albums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
The XNA Music Classes: MediaPlayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735

What do you think of this book? We want to hear from you!


M crosoft s nterested n hear ng your feedback so we can cont nua y mprove our
books and earn ng resources for you. To part c pate n a br ef on ne survey, p ease v s t:

microsoft.com/learning/booksurvey
Introduction
Important Th s book and Microsoft XNA Framework Edition: Programming Windows Phone 7
are fu y ndexed, pr nt-book vers ons of a s ng e free, e ectron c ed t on t t ed Programming
Windows Phone 7, wh ch you can find on the M crosoft Press b og http://blogs.msdn.com/b/
microsoft press/. No changes have been made to the or g na ed t on’s text, nc ud ng references
to the co or of the or g na mages, wh ch appear b ack and wh te n th s book What fo ows s the
Introduct on that or g na y appeared n Programming Windows Phone 7; “Code Samp es” s the
on y sect on n th s Introduct on that has been updated

This book is a gift from the Windows Phone 7 team at Microsoft to the programming
community, and I am proud to have been a part of it. Within the pages that follow, I show
you the basics of writing applications for Windows Phone 7 using the C# programming
language with the Silverlight and XNA 2D frameworks.

Yes, Programming Windows Phone 7 is truly a free download, but for those readers who still
love paper—as I certainly do—this book will also be available (for sale) divided into two
fully-indexed print editions: Microsoft Silverlight Edition: Programming Windows Phone 7 and
Microsoft XNA Framework Edition: Programming Windows Phone 7.

With the money you’ve saved downloading this book, please buy other books. Despite
the plethora of information available online, books are still the best way to learn about
programming within a coherent and cohesive tutorial narrative. Every book sale brings a tear
of joy to an author’s eye, so please help make them weep overflowing rivers.

In particular, you might want to buy other books to supplement the material in this book.
For example, I barely mention Web services in this book, and that’s a serious deficiency
because Web services are likely to become increasingly important in Windows Phone 7
applications. My coverage of XNA is limited to 2D graphics and while I hope to add several
3D chapters in the next edition of this book, I don’t really get into the whole Xbox LIVE
community aspect of game development. Nor do I discuss any programming tools beyond
Visual Studio—not even Expression Blend.

My publisher Microsoft Press has a couple additional Windows Phone 7 books coming soon:
Windows Phone 7 Silverlight Development Step by Step by Andy Wigley & Peter Foot offers
a more tools-oriented approach. Although Michael Stroh’s Windows Phone 7 Plain & Simple
is a guide to using the phone rather than developing for it, I suspect it will give developers
some insights and ideas.

Moreover, I also hear that my old friend Doug Boling is working hard on a Windows Phone
7 enterprise-programming book that is likely to be considered his masterpiece. Be sure to
check out that one.

xi
xii Introduction

Organization
This book is divided into three parts. The first part discusses basic concepts of Windows
Phone 7 programming using example programs that target both Silverlight and the XNA
framework. It is likely that many Windows Phone 7 developers will choose either one
platform or the other, but I think it’s important for all developers who have at least a little
knowledge of the alternative to their chosen path.

The second part of this book focuses entirely on Silverlight, and the third part on XNA
2D. For your convenience, the chapters in each part build upon previous knowledge in
a progressive tutorial narrative, and hence are intended to be read sequentially.

My Assumptions About You


I assume that you know the basic principles of .NET programming and you have a working
familiarity with the C# programming language. If not, you might benefit from reading my
free online book .NET Book Zero: What the C or C++ Programmer Needs to Know about C#
and the .NET Framework, available from my website at www.charlespetzold.com/dotnet.

System Requirements
To use this book properly you’ll need to download and install the Windows Phone
Developer Tools, which includes Visual Studio 2010 Express for Windows Phone, XNA Game
Studio 4.0, and an on-screen Windows Phone Emulator to test your programs in the absence
of an actual device. Get the latest information and downloads at http://developer
.windowsphone.com.

You can install these tools on top of Visual Studio 2010, in effect enhancing Visual Studio
2010 for phone development. That’s the configuration I used.

Although you can do quite a bit with the phone emulator, at some point you’ll want to
deploy your programs to an actual Windows Phone 7 device. You can register as a phone
developer at http://developer.windowsphone.com and then have the ability to unlock your
phone so you can deploy your programs from Visual Studio.

Since late July 2010, I’ve had an LG GW910 phone to test the programs in this book. For the
record, the final build I installed was 7.0.7003.0.

Using the Phone Emulator


Windows Phone 7 supports multi-touch, and working with multi-touch is an important part
of developing programs for the phone. When using the Windows Phone Emulator, mouse
clicks and mouse movement on the PC can mimic touch on the emulator, but for only one
Introduction xiii

finger. You can test out multi-touch for real on the phone emulator if you have a multi-touch
monitor running under Windows 7.

In the absence of a multi-touch monitor, you might want to explore simulating multi-touch
with multiple mouse devices. The site http://multitouchvista.codeplex.com has the download
you’ll need and includes a link to http://michaelsync.net/2010/04/06/step-by-step-tutorial-
installing-multi-touch-simulator-for-silverlight-phone-7 that provides instructions.

Windows Phone 7 devices also have a built-in accelerometer, which can be very difficult
to simulate in an emulator. Per Blomqvist, the Technical Reviewer for this book, found an
application at http://accelkit.codeplex.com that utilizes the webcam and ARToolkit to emulate
the accelerometer sensor and feed that data into the Windows Phone 7 emulator through
a TCP/HTTP Server, and although neither of us have tried it out, it sounds quite intriguing.

Code Samples
To illustrate Silverlight and XNA programming concepts, this book describes about
190 complete programs. Many of them are small and simple, but others are larger and
more interesting.

Some people like to learn new programming environments by re-creating the projects in
Visual Studio and typing in the source code themselves from the pages of the book. Others
prefer to study the code and run the pre-existing programs to see what the code does. If
you fall into the latter category, you can download all the source code in a ZIP file via the
Companion Content link at http://oreilly.com/catalog/0790145316707/.

If you find something in the code that is useful in your own software project, feel free to use
the code without restriction—either straight up or modified in whatever way you want. That’s
what it’s there for.

Last-Minute Items
As I was nearing the completion this book, the first version of the Silverlight for Windows
Phone Toolkit was released with some additional elements and controls, and is available for
downloading at http://silverlight.codeplex.com. Historically, these Silverlight toolkits very often
contain previews of elements and controls that are incorporated into later Silverlight releases.
I regret that I could not include a discussion of the toolkit contents in the appropriate
chapters of this book.

With XNA programs, sometimes Visual Studio complains that it can’t build or deploy
the program. If you encounter that problem, in the Solution Platforms drop-down list
on the standard toolbar, select “Windows Phone” rather than “Any CPU”. Or, invoke the
xiv Introduction

Configuration Manager from the Build menu, and in the Active Solution Platform drop-down
select “Windows Phone” rather than “Any CPU”.

The www.charlespetzold.com/phone page on my website will contain information about this


book and perhaps even some information about a future edition. I also hope to blog about
Windows Phone 7 programming as much as possible.

The Essential People


This book owes its existence to Dave Edson—an old friend from the early 1990s era
of Microsoft Systems Journal—who had the brilliant idea that I would be the perfect person
to write a tutorial on Windows Phone 7. Dave arranged for me to attend a technical deep
dive on the phone at Microsoft in December 2009, and I was hooked. Todd Brix gave the
thumbs up on the book, and Anand Iyer coordinated the project with Microsoft Press.

At Microsoft Press, Ben Ryan launched the project and Devon Musgrave had the unenviable
job of trying to make my code and prose resemble an actual book. (We all go way back:
You’ll see Ben and Devon’s names on the bottom of the copyright page of Programming
Windows, fifth edition, published in 1998.)

My Technical Reviewer was the diligent Per Blomqvist, who apparently tested all the code in
both the sample files and as the listings appear in the book, and who in the process caught
several errors on my part that were truly, well, shocking.

Dave Edson also reviewed some chapters and served as conduit to the Windows Phone team
to deal with my technical problems and questions. Early on, Aaron Stebner provided essential
guidance; Michael Klucher reviewed chapters, and Kirti Deshpande, Charlie Kindel, Casey
McGee, and Shawn Oster also had important things to tell me. Thanks to Bonnie Lehenbauer
for reviewing a chapter.

I am also indebted to Shawn Hargreaves for his XNA expertise, and Yochay Kiriaty and
Richard Bailey for the lowdown on tombstoning.

My wife Deirdre Sinnott has been a marvel of patience and tolerance over the past
months as she dealt with an author given to sudden mood swings, insane yelling at the
computer screen, and the conviction that the difficulty of writing a book relieves one of the
responsibility of performing basic household chores.

Alas, I can’t blame any of them for bugs or other problems that remain in this book. Those
are all mine.

Charles Petzold
New York City and Roscoe, New York
October 22, 2010
Introduction xv

Errata & Book Support


We’ve made every effort to ensure the accuracy of this book and its companion content.
If you do find an error, e-mail Microsoft Press Book Support at mspinput@microsoft.com.
(Please note that product support for Microsoft software is not offered through this address.)

We Want to Hear from You


At Microsoft Press, your satisfaction is our top priority, and your feedback our most valuable
asset. Please tell us what you think of this book at:

http://www.microsoft.com/learning/booksurvey

The survey is short, and we read every one of your comments and ideas. Thanks in advance
for your input.

Stay in Touch
Let’s keep the conversation going! We’re on Twitter: http://twitter.com/MicrosoftPress
Part I
The Basics

1
Chapter 1
Hello, Windows Phone 7
Sometimes it becomes apparent that previous approaches to a problem haven’t quite worked
the way you anticipated. Perhaps you just need to clear away the smoky residue of the past,
take a deep breath, and try again with a new attitude and fresh ideas. In golf, it’s known as
a “mulligan”; in schoolyard sports, it’s called a “do-over”; and in the computer industry, we
say it’s a “reboot.”

A reboot is what Microsoft has initiated with its new approach to the mobile phone market.
With its clean look, striking fonts, and new organizational paradigms, Microsoft Windows
Phone 7 not only represents a break with the Windows Mobile past but also differentiates
itself from other smartphones currently in the market. Windows Phone 7 devices will be
made by several manufacturers and available with a variety of cell providers.

For programmers, Windows Phone 7 is also exciting, for it supports two popular and modern
programming platforms: Silverlight and XNA.

Silverlight—a spinoff of the client-based Windows Presentation Foundation (WPF)—has


already given Web programmers unprecedented power to develop sophisticated user
interfaces with a mix of traditional controls, high-quality text, vector graphics, media,
animation, and data binding that run on multiple platforms and browsers. Windows Phone 7
extends Silverlight to mobile devices.

XNA—the three letters stand for something like “XNA is Not an Acronym”—is Microsoft’s
game platform supporting both 2D sprite-based and 3D graphics with a traditional
game-loop architecture. Although XNA is mostly associated with writing games for the Xbox
360 console, developers can also use XNA to target the PC itself, as well as Microsoft’s classy
audio player, the Zune HD.

Either Silverlight or XNA would make good sense as the sole application platform for the
Windows Phone 7, but programmers have a choice. And this we call “an embarrassment of riches.”

Targeting Windows Phone 7


All programs for Windows Phone 7 are written in .NET managed code. Although the sample
programs in this book are written in the C# programming language, it is also possible to
write Windows Phone 7 applications in Visual Basic .NET. The free downloadable Microsoft
Visual Studio 2010 Express for Windows Phone includes XNA Game Studio 4.0 and an
on-screen phone emulator, and also integrates with Visual Studio 2010. You can develop
visuals and animations for Silverlight applications using Microsoft Expression Blend.

3
4 Part I The Basics

The Silverlight and XNA platforms for Windows Phone 7 share some libraries, and you
can use some XNA libraries in a Silverlight program and vice versa. But you can’t create
a program that mixes visuals from both platforms. Maybe that will be possible in the future,
but not now. Before you create a Visual Studio project, you must decide whether your
million-dollar idea is a Silverlight program or an XNA program.

Generally you’ll choose Silverlight for writing programs you might classify as applications
or utilities. These programs are built from a combination of markup and code. The markup
is the Extensible Application Markup Language, or XAML and pronounced “zammel.” The
XAML mostly defines a layout of user-interface controls and panels. Code-behind files can
also perform some initialization and logic, but are generally relegated to handling events
from the controls. Silverlight is great for bringing to the Windows Phone the style of Rich
Internet Applications (RIA), including media and the Web. Silverlight for Windows Phone
is a version of Silverlight 3 excluding some features not appropriate for the phone, but
compensating with some enhancements.

XNA is primarily for writing high-performance games. For 2D games, you define sprites and
backgrounds based around bitmaps; for 3D games you define models in 3D space. The action
of the game, which includes moving graphical objects around the screen and polling for user
input, is synchronized by the built-in XNA game loop.

The differentiation between Silverlight-based applications and XNA-based games is


convenient but not restrictive. You can certainly use Silverlight for writing games and you
can even write traditional applications using XNA, although doing so might sometimes be
challenging.

In particular, Silverlight might be ideal for games that are less graphically oriented, or
use vector graphics rather than bitmap graphics, or are paced by user-time rather than
clock-time. A Tetris-type program might work quite well in Silverlight. You’ll probably find
XNA to be a bit harder to stretch into Silverlight territory, however. Implementing a list box in
XNA might be considered “fun” by some programmers but a torture by many others.

The first several chapters in this book describe Silverlight and XNA together, and then the book
splits into different parts for the two platforms. I suspect that some developers will stick with
either Silverlight or XNA exclusively and won’t even bother learning the other environment.
I hope that’s not a common attitude. The good news is that Silverlight and XNA are so
dissimilar that you can probably bounce back and forth between them without confusion!

Microsoft has been positioning Silverlight as the front end or “face” of the cloud, so cloud
services and Windows Azure form an important part of Windows Phone 7 development. The
Windows Phone is “cloud-ready.” Programs are location-aware and have access to maps and
other data through Bing and Windows Live. One of the available cloud services is Xbox Live,
Chapter 1 Hello, Windows Phone 7 5

which allows XNA-based programs to participate in online multiplayer games, and can also
be accessed by Silverlight applications.

Programs you write for the Windows Phone 7 will be sold and deployed through the
Windows Phone Marketplace, which provides registration services and certifies that
programs meet minimum standards of reliability, efficiency, and good behavior.

I’ve characterized Windows Phone 7 as representing a severe break with the past. If you
compare it with past versions of Windows Mobile, that is certainly true. But the support
of Silverlight, XNA, and C# are not breaks with the past, but a balance of continuity and
innovation. As young as they are, Silverlight and XNA have already proven themselves as
powerful and popular platforms. Many skilled programmers are already working with either
one framework or the other—probably not so many with both just yet—and they have
expressed their enthusiasm with a wealth of online information and communities. C# has
become the favorite language of many programmers (myself included), and developers can
use C# to share libraries between their Silverlight and XNA programs as well as programs for
other .NET environments.

The Hardware Chassis


Developers with experience targeting Windows Mobile devices of the past will find significant
changes in Microsoft’s strategy for the Windows Phone 7. Microsoft has been extremely
proactive in defining the hardware specification, often referred to as a “chassis.”

Initial releases of Windows Phone 7 devices will have one consistent screen size. (A second
screen size is expected in the future.) Many other hardware features are guaranteed to exist
on each device.

The front of the phone consists of a multi-touch display and three hardware buttons
generally positioned in a row below the display. From left to right, these buttons are called
Back, Start, and Search:

■ Back Programs can use this button for their own navigation needs, much like the
Back button on a Web browser. From the home page of a program, the button causes
the program to terminate.
■ Start This button takes the user to the start screen of the phone; it is otherwise
inaccessible to programs running on the phone.
■ Search The operating system uses this button to initiate a search feature.
Another Random Scribd Document
with Unrelated Content
— sericea, L. — discolor, Panz. On the moors above Liskeard —
affinis, Kunze Lema cyanella, L. Tregantle (Keys) ; Gerrans Bay ;
Penzance — lichenis, Voet. Gunnislake (Keys). — melanopa, L.
Crioceris asparagi, L. The asparagus beetle. This has frequently
appeared on asparagus in the county during the past five years, but
not so far in such numbers as to cause alarm ; has been found on
the moors at Altarnun CAMPTOSOMATA Clythra quadripunctata, L.
Cryptocephalus aureolus, Suffr. One specimen Whitsand Bay
(Bignell) — hypochaeridis. L. Looe. — fulvus, Goeze. Whitsand Bay ;
Falmouth ; St. Mary's, Scilly .-:n.,~ T? pusillus, F. labiatus, L. 198
CHRYSOMELIDAE (continued) CYCLICA Lamprosoma concolor,
Sturm. Whitsand Bay (Keys) ; Gerran's Bay ; Falmouth ; Penzance
Timarcha tenebricosa, F. — violaceo-nigra, De G. Chrysomela banksi,
F. Millook ; Whitsand Bay (Keys) ; Padstow (Lamb) ; Falmouth ;
Penzance — staphylea, L. — polita, L. — orichalcia, Milll. —
haemoptera, L. Whitsand Bay ; Getran's Bay ; in great profusion
some years, Penzance ; Netvfuay; Mavigan-inPydar ; Padstow
(Lamb) — varians, Schall. Around Mount's Bay — goettingensis, L.
Rame Hd. (Keys) — fastuosa, Scop. Altarnun ; Liskeard ; Penzance
— didymata, Scriba. — hyperici, Ffirst. Melasoma aeneum, L.
Liskeard — populi, L. Phytodecta olivacea, Forst. var. litura, F. Penryn
; Penzance Gastroidea viridula, De G. — polygoni, L. Phaedon
tumidulus, Germ. — armoraciae, L. This appeared in quantity for the
first time of recent years in 1902, when it caused much damage to
cabbage and turnip crops in the south-east of the county. It has not
been reported since — cochleariae, F. Phyllodecta vulgatissima, L —
cavifrons, Thorns. — vitellinae, L. Hydrothassa aucta, F. —
marginella, L. Prasocuris junci, Brahm — phellandrii, L. Phyllobrotica
quadrimaculata, L. Valley of the Lynher Luperus nigrofasciatus,
Goeze — rufipes, Scop. — flavipes, L. Lochmaea capreae, L. —
suturalis, Thorns. — crataegi, FOrst. Galerucella nymphaeae, L. On
buckwheats at Nance, Truro, |9°3 — sagittariae, Gyll. — lineola, F. —
calmariensis, L. — - tenella, L. /.dimonia tanaceti, L. Getran's Bay ;
Land's End (Isabell)
The text on this page is estimated to be only 27.48%
accurate

INSECTS CHRYSOMELIDAE (continued) CYCLICA


(continued) Sermyla halensis, L. Longitarsus holsaticus, L. — luridus,
Scop. — brunneus, Duft. — suturellus, Duft. — atricillus, L. —
melanocephalus, All. — atriceps, Kuts. — suturalis, Marsh. Taken by
Isabel! near Sennen — membranaceus, Foudr. Tintagel —
waterhousei, Kuts. Reported by Marquand from the neighbourhood
of Penzance — flavicornis, Steph. — femoralis, Marsh. S. — pusillus,
Gyll. — tabidus, F. — jacobaeae, Wat. S. — rutilus, 111. Paditoto
(Lamb) — ochroleucus, Marsh. — gracilis, Kuts. — laevis, Duft.
Haltica lythri, Aub6 — oleracea, L. — pusilla, Duft. Hermaeophaga
mercurialis, F. Kilkbampton Phyllotreta nodicornis, Marsh. Two
specimens taken by Thomas near Looe in 1904. - nigripes, F. —
consobrina, Curt. Whitsand Bay ; West Cornwall, scarce —
punctulata, Marsh. — atra, Payk. Looe; Padstotv (Lamb) ; St. Mary's,
Sdlly — vittula, Redt. S. — undulata, Kuts. S. — nemorum, L. S. —
ochripes, Curt. — exclamationis, Thunb. This genus, under the name
of turnip fly, is only too well known throughout the county, as it at
times works serious havoc on the turnip crop while still in the
smooth leaf or cotyledon stage. P. nemorum is the dominant species,
but in 1902 several fields about St. Columb were badly attacked by
P. undulata. In the spring of 1903 the foliage of the early potatoes at
St. Mary's, Stilly, was injured by P. atra. A few years ago a field of
dredge corn near St. Agnes was practically smothered with charlock,
but about the beginning of June P. vittula was noticed in great
numbers on the weed, and in a fortnight every visible charlock leaf
was completely riddled Aphthona lutescens, Gyll. Netvjuay -
nonstriata, Goeze. Padstow (Lamb) ; Netvjuay CHRYSOMELIDAE
(continued) CYCLICA (continued) Aphthona venustula, Kuts. —
atrocoerulea, Steph. — virescens, Foudr. In some number near
Liskeard in 1904 Batophila rubi, Payk. — aerata, Marsh.
Sphaeroderma testaceum, F. S. — cardui, Gyll. Apteropeda
orbiculata, Marsh. — globosa, 111. Penzance district (Marquand)
Mniophila muscorum, Koch. Podagrica fuscipes, L. — fuscicornis, L.
Mantura rustica, L. Crepidoderat ransversa, Marsh. — ferruginea,
Scop. — rufipes, L. — ventralis, 111. — helxines, L. — chloris, Foudr.
— aurata, Marsh. — smaragdina, Foudr. Hippuriphila modeeri, L.
Chaetoncema hortensis, Fourc. Plectroscelis concinna, Marsh. The
brassy turnip flea. It is often common in different parts of the
county, but so far as known has not committed any serious
depredations since systematic observations began seven years ago
Psylliodes chrysocephala, L. Tregantle var. nigricollis, Marsh. One
specimen Tregantle (Keys) — napi, Koch. S. — cuprea, Koch. —
affinis, Payk. — marcida, 111. Abundant at times under cakile,
Tregantle (Keys) ; Netvjuay ; Scilly — chalcomera, 111. Tregantle ;
Looe — hyoscyami, L. Trevaylor valley ; Penzance (Marquand)
CRYPTOSOMATA Cassida murraea, L. Millook ; banks of the Linney
— vibex, F. — vittata, Vill. — nobilis, L. Mount Edgcumbe ; Tregantle
(Keys) ; on scurvy grass, Nttvjuay — flaveola, Thunb. Whitsand Bay
(Keys) ; Gerrani Bay ; Penzance — equestris, F. On marshy ground,
Dotvnderry (Keys) ; common on mint at Little Canaan, Truro ; fairly
plentiful round the head of Mount's Bay — viridis, F. 199
CHRYSQMELlDAE(«wrf«
The text on this page is estimated to be only 25.64%
accurate

A HISTORY OF CORNWALL OEDEMERIDAE Oedemera


nobilis, Scop. • — lurida, Marsh. Oncomera femorata, F. In some
numbers when sugiring at Truro, April, 1900 Nacerdes melanura,
Schmidt Ischnomera coerulea, L. PYROCHROIDAE Pyrochroa
serraticornis, Scop. MORDELLIDAE Mordella fasciata, F. Launceston
(Peter) Mordellistena pumila, Gyll. Caliington — parvula var.
inaequalis, Muls. Trcgantle (Keys) Anaspis frontalis, L. — pulicaria,
Costa - rufilabris, Gyll. — geoffroyi, Mill!. On white thorn, Lostwithtel
— ruficollis, F. - flava, L. Ludgvan ; Trevaylor valley, Penzance var.
thoracica, L. Trevaylor valley • — subtestacea, Steph. — maculata,
Fourc. RHIPIDOPHORIDAE Metoecus paradoxus, L. ANTHICIDAE
Notoxus monoceros, L. Anthicus humilis, Germ. Recorded from Sally
by F. Holmes - floralis, L. — antherinus, L. XYLOPHILIDAE Xylophilus
oculatus, Gyll. Taken in decaying willow near Doublebots in 1905
MELOIDAE Meloe proscarabaeus, L. S. — violaceus, Marsh. Wbitsand
Bay (Keys) ; Calstock ; valley of the Lynher - autumnalis, Ol. Valley
of the Lynher — - rugosus, Marsh. Loot valley - brevicollis, Panz.
Saltash ; on the moors above Liskeard Sitaris muralis, FOrst. Truro.
This extremely interesting species has occurred sparingly for the
past three years in a very restricted area not far from Truro about
the nests of Anthophora. On 14 April, 1904, a female bee was
caught with several of the early stage larvae of Sitaris attached to
the body hairs ANTHRIBIDAE Brachytarsus fasciatus, FOrst.
CURCU.LIONIDAE Apoderus coryli, L. In the Kilkhampton district
Attelabus curculionoides, L. Millook Byctiscus populi, L. Launceston
(Peter) Rhynchites aeneovirens, Marsh. Falmouth ; Penzance district
(Marquand) — minutus, Herbst. Neti-fuay ; Penzance —
interpunctatus, Steph. Netvquay — nanus, Payk. — pubescens, F.
DeporaUs betulae, L. Apion pomonae, F. — • craccae, L. Hehton —
subulatum, Kirby. — ulicis, Forst. — malvae, F. Widespread but
scarce — urticarium, Herbst. Launceston — miniatum, Germ. - —
cruentatum, Walt. Scarce in E. Cornwall • — haematodes, Kirby. S.
— rubens, Steph. — rufirostre, F. — viciae, Payk. Tregantle (Keys) ;
Boscastle — diffbrme, Germ. Netequay ; Perranforth — varipes,
Germ. Netojuay ; Penzance — laevicolle, Kirby. Though generally
regarded as essentially of the south-eastern counties this insect has
been taken by Keys at Whitsand Bay — apricans, Herbst —
bohemani, Thorns. On restharrow, Tregantle (Keys) ; Patbtew —
trifolii, L. — dichroum, Bedel. — nigritarse, Kirby. Whitiand Bay ;
Boscastle ; Penzance — confluens, Kirby. On Matricaria, Whitsand
Bay (Keys) — hookcri, Kirby. Whitsand Bay ; Looe ; Gerran's Bay —
aeneum, F. — radiolus, Kirby — onopordi, Kirby — • carduorum,
Kirby. S. — atomarium, Kirby. On thyme, Tregantle (Keys) —
minimum, Herbst. Round the head of Mount's Say — • virens, Herbst
• — punctigerum, Payk. Boscastle ; Newjuay 200 CURCULIONIDAE
(continued) Apion pisi, F. S. — aethiops, Herbst — ebeninum, Kirby
— filirostre, Kirby. Looe; Padsttw - — striatum, Kirby — immune,
Kirby. Bade ; Gcrran't Bay; Perranforth — ononis, Kirby — spencei,
Kirby — ervi, Kirby — vorax, Herbst — gyllenhali, Kirby. Tregantle
(Keys) — scutellare, Kirby. Widespread in gorse, generally with A.
striatum, but very scarce — waltoni, Steph. Whilsand Bay (J. J.
Walker) — loti, Kirby. S. — seniculum, Kirby — tenue, Kirby — simile,
Kirby. Gerran's Bay ; Falmouth — pubescens, Kirby. Padstoto (Lamb)
— violaceum, Kirby — hydrolapathi, Kirby. S. — humile, Germ. The
larvae of the genus Apion feed for the most part on seeds and seed-
pods, more especially of the Leguminosae. In 1901 the attacks from
A. pomonae on vetches in the east of the county were severe and
not confined to the seed-pods, as in two cases the foliage also was
badly eaten. From Doublebois to Liskeard scarcely a specimen of
Vicia sepium by the roadside escaped their attention. In 1902 they
again appeared in considerable numbers, but since 1903 the beetle
has been scarce. A. apricans was very abundant from 1900 to 1902
about Wadebridge, and did considerable damage to the seeding
clovers. In 1903 a plot of red clover at Nanoe, Truro, was badly
attacked. Last year it was uncomfortably plentiful about Liskeard. A.
trifolii and A. virens have both been hatched out of red clover pods,
A. dichroum out of white, and A. nigritarse out of crimson (Trifolium
incarnatum) and out of kidney vetch Otiorrhynchus tenebricosus,
Herbst • — fuscipes, Walt. — atroapterus, De G. In moss and short
grass at Perranforth ; on brambles at S/. Ivet ; Penzance district
(Marquand) ; S/. Mary's and St. Martin's, Stilly — blandus, Gyll.
Reported by Isabel! from Land's End, but probably in error
The text on this page is estimated to be only 26.72%
accurate

INSECTS CURCULIONIDAE (continued) Otiorrhynchus


scabrosus, Mnrsh. Whit sand Bay ; Llskeard — ligneus, Ol. S. —
picipes, F. — sulcatus, F. S. - rugifrons, Gyll. Widespread. S. —
ovatus, L. S. The genus Otiorrhynchus frequently causes great
damage in the garden, as the beetles feed on leaves, shoots, flowers
and even fruit, while the larvae live on roots. O. sulcatus is very
destructive to strawberries throughout the county, and is everywhere
bad on neglected vines. Peaches, primulas, saxifrages, cyclamens,
maidenhairs, and begonias have all been damaged more or less
throughout the county by this species during the last seven years. O.
picipes attacks the apple, the gooseberry, and more especially the
raspberry, and in 1878 did an enormous amount of damage to the
raspberry canes about Gulval and Madron. O. tenebricosus infested
some strawberry beds near Truro during 1903 and 1904, and if it
spread will cause enormous loss throughout the county
Trachyphloeus squamulatus, Ol. Obtained by Isabell in the Land's
End district ; one specimen taken near St. Ives in 1900 — scaber, L.
— scabriculus, L. Caenopsis fissirostris, Walt. Valley of the Lynhcr —
waltoni, SchOn. Whitsand Bay east Strophosomus coryli, F. —
capitatus, De G. — retusus, Marsh. S. — faber, Herbst. Taken by J. J.
Walker at Whitsand Bay — lateralis, Payk. Exomias araneiformis,
Schr. — pyrenaeus, Leidl. First discovered as a British insect by Keys
in the Plymouth district ; subsequently taken by Champion in
Cornwall Brachysomusechinatus,Bonsd. One specimen in Bishop's
Wood, Truro, May, 1902 Sciaphilus muricatus, F. Tropiphorus
tomentosus, Marsh. Barypeithes sulcifrons, Boh. Mount Edgcumbe
(Wollaston) ; at times frequent, Whltsand Bay (Keys) Liophloeus
nubilus, F. Polydrusus tereticollis, De G. — pterygomalis, Boh. —
cervinus, L. CURCULIONIDAE (continued} CURCULIONIDAE
(continued) Polydrusus chrysomela, OL One from the Ganne /,near
Newquay — confluens, Steph. On broom near Wadebrldge Phyllobius
oblongus, L. — calcaratus, F. — urticae, De G. — pyri, L. —
argentatus, L. — maculicornis, Germ. — viridiaeris, Laich. Lostwlthiel
; Penzance Tanyinecus palliatus, F. S. Petherwln, among coarse
herbage growing between large slabs of slate Philopedon geminatus,
F. S. Barynotus obscurus, F. — elevatus, Marsh. On bracken,
Netvfuay Alophus triguttatus, F. Under stones and moss, Hayie and
Penzance Sitones griseus, F. — cambricus, Steph. Penlee (Keys) ;
between My/or and Trefusls, under cast- up larch-pole ; Scilly —
regensteinensis, Herbst — waterhousei,Walt. Whitsand Bay —
crinitus, Herbst — tibialis, Herbst — hispidulus, F. — humeralis,
Steph. — flavescens, Marsh. — puncticollis, Steph. S. — suturalis,
Steph. — lineatus, L. The clover weevil. In some years this does
considerable damage to young seeds. In 1897, 1898, and 1899 it
was abundant in almost every district in the county. In 1900 it was
apparently nowhere common till the middle of July, and from that
time till 1905 it was decidedly scarce. Last year it appeared in great
numbers among clover near Wadebridge and caused extensive injury
to peas about Bodmin — sulcifrons, Thunb. Limobius dissimilis,
Herbst. One taken last year on Geranium sanguineum near
Chapelporth, St. jfgnes — Hypera punctata, F. S. — fasciculata,
Herbst. Three on Erodium cicutarium on the sand at Perranpoilh —
rumicus, L. - — pollux, F. Marazlon Marsh — polygon!, L. —
suspiciosa, Herbst. Widespread but scarce along the south coas-t
201 Limobius variabilis, Herbst. Padstow ; Truro; Penzance; St.
Mary's, Scilly — murina, F. Hay/eand Penzance - — plantaginis, De
G. S. — trilineata, Marsh. — nigrirostris, F. Rhinocyllus latirostris,
Latr. Rare on thistles, Penzance district (Marquand) Cleonus
sulcirostris, L. Padstou (Lamb) ; Perranporth Larinus carlinae, Ol.
Obtained, 1905, near the Lion's Den, Millook Liosoma ovatulum,
Clairv. Liparus coronatus, Goeze. One at Tregantle (Keys) ; Get ran' s
Bay ; Penzance district (Marquand) Hylobius abietis, L. At Trebartha ;
one near Penzance (Marquand) Orchestes quercus, L. — alni, L. —
ilicis, F. Two on oak, Coombe Valley, Kilkkampton — avellanae, Doh.
— fagi, L. — rusci, Herbst — salicis, L. — saliceti, Payk. On young
willows, Hayle ; Penzance Rhamphus flavicornis, Clairv. Orthocaetes
setiger, Beck. Whitsand Bay east ; Penzance ; St. Mary's and Tresco,
Scilly Erirrhinus acridulus, L. Dorytomus tremulae, F. Penzance
district (Marquand) — tortrix, L. Under poplar bark, Truro —
maculatus, Marsh. — pectoralis, Gyll. Smicronyx jungermanniae,
Reich. One specimen by sweeping at Tregantle (Keys) Tanysphyrus
lemnae, F. Steanpool ; Marazlon Marsh Bagous alismatis, Marsh.
Anoplus plantaris, Naez. Upper Tamar district Elleschus bipunctatus,
L. Trebartha Tychius schneideri, Herbst. Whitsand Bay and Falmouth
(Fowler) — lineatulus, Steph. — junceus, Reich. Mount Edgcumbe —
tomentosus, Herbst. Neivjuay Miccotrogus picirostris, F. Sibinia
arenariae, Steph. — primita, Herbst. S.E. Cornwall Miarus micros,
Germ. In vol. i of the Entomologist, p. 220, Crotch reports the
capture of two specimens by Wollaston at Whitsand Bay east ; still
the only British record 26
The text on this page is estimated to be only 27.61%
accurate

A HISTORY OF CORNWALL CURCULIONIDAE (continued)


CURCULIONIDAE (continued) Gymnetron bcccabungae, F. —
pascuorum, Gyll. — antirrhini, Payk. Mecinus pyraster, Herbst —
circulatus, Marsh. Anthonomus ulmi, De G. — rosinae, Des Gozis —
pedicularius, L. — pomorum, L. Though widely spread in the county
this beetle has not hitherto caused serious damage to the fruit
crops. It appeared in some quantity in the St. Columb district in
1901, and brown undeveloped flower-buds of the apple, occasionally
with the little white wrinkled dark horny-headed grub inside, have
been sent in from Penzance, Bodmin and Eoscastle, and have been
observed in numbers at Callington and — rubi, Herbst Nanophyes
lythri, F. Clonus scrophulariae, L. — tuberculosus, Scop. One
specimen by the Gunnel — blattariae, F. — pulchellus, Herbst
Orobitis cyaneus, L. Cryptorrhynchus lapathi, L. Acalles ptinoides,
Marsh. — turbatus, Boh. Millbrook (Keys) Coeliodes rubicundus,
Herbst. Penzance district (Marquand) — quercus, F. — ruber, Marsh.
— cardui, Herbst — quadrimaculatus, L. S. — exiguus, Ol.
Poophagus sisymbrii, F. — nasturtii, Germ. Sparingly on the Inney,
not far from Altamun Ceuthorrhynchus assimilis, Payk. — syrites,
Germ. Padstow (Lamb) — setosus, Boh. Wkitsand Bay (Fowler) —
constrictus, Marsh. Poundstock — cochleariae, Gyll. - ericae, Gyll. S.
— erysimi, F. — contractus, Marsh. — quadridens, Panz. S. —
gcographicus, Goeze. Pencalenick, Truro — pollinarius, FOrst —
pleurostigma, Marsh. This beetle occasionally lays its eggs in
considerable numbers on the roots of turnips, swedes, cabbages and
broccoli, and the larvae on emerging cause local growth and the
formation of unilocular root galls rarely more than a half to three-
quarters of an inch in diameter. A badlyinfested swede from Bodmin
carried no less than sixtythree, together with a few warty
excrescences on the ' bulb.' The root crop is evidently not much
affected by the presence of these galls, but young broccoli in the
west of the county are occasionally ruined Ceuthorrhynchus
verrucatus, Gyll. Widespread but very local - punctiger, Gyll. One
specimen at Tregantle (Keys) - marginatus, Payk. One specimen,
Boscastle (Keys) — rugulosus, Herbst. Looe valley — melanostictus,
Marsh. Marazion Marsh ; Land's End district — chrysanthemi, Germ.
Whitsand Bay (Keys) — litura, F. — trimaculatus, F. Whltsand Bay
(Fowler) ; Padstow (Lamb) ; Newjuay Ceuthorrhynchidius floral is,
Payk. — pyrrorhynchus, Marsh. — nigrinus, Marsh. Looe valley —
melanarius, Steph. — terminatus, Herbst. Land's End (Isabell) —
horridus, F. Gerran's Say - quercicola, Payk. One specimen in the
valley of the Lynher — troglodytes, F. S. — dawsoni, Bris. Formerly
abundant at WhitsandBay, and still taken there by Keys Rhinoncus
pericarpius, L. • — gramineus, Herbst — perpendicularis, Reich. One
specimen, Dotvnderry (Keys) — castor, F. Widespread but very
scarce — bruchoides, Herbst. Truro; Falmouth ; Penzance
Litodactylus leucogaster, Marsh. Phytobius waltoni, Boh. Around
Penzance — quadrituberculatus, F. Whitsand Bay (Keys) —
canaliculatus, Fabr. Balaninus venosus, Grav. — nucum, L. Two
specimens at L'ukeard — villosus, F. — salicivorus, Payk. —
pyrrhoceras, Marsh. Magdalis armigera, Fourc. — pruni, L. Calandra
granaria, L. — oryzae, L. Cossonus ferruginous, Clairv. Valley of the
Lynher 202 CURCULIONIDAE (continued) Rhopalomesites tardyi,
Curt. Mount Edgcumbe Park; on an ash at Millbrook (Keys) ; near St.
Clement's, Truro Rhyncolus lignarius, Marsh. Caulotrypis
aeneopiceus, Boh. Millbrook ; Fotvey ; Falmouth Codiosoma spadix,
Herbst. Old piles on the shore, South Down (Keys) ; Falmoulh ; in
drift wood, Trefuiis SCOLYTIDAE Scolytus destructor, Ol. This beetle
often destroys the bark of felled elm in different parts of the county,
and a fine series of old elms in Tregolls Road, Truro, were cut down
in the winter of 1905—6 on account of the ravages committed for
some years back by the repeated mining operations of this beetle
and its larvae just under the bark — rugulosus, Ratz. This beetle
appeared in considerable numbers in 1901 in some Lord Grosvenor
apple trees near Callington that were badly cankered. Lately the
beetle has been rather common about Saltash. As in the case of S.
destructor, the female tunnels vertically between sapwood and bark,
laying her eggs at short intervals, and the larvae when hatched
continue burrowing and feeding at right angles to the parent gallery
till they reach maturity Hylastes ater, Payk. Gunnislake ; Penlee
Woods (Keys) ; Bishops Wood, Truro ; one from College Wood,
Penryn Hylastinus obscurus, Marsh. Hylesinus crenatus, F. — fraxini,
Panz. — vittatus, F. Myelophilus piniperda, L. Cissophagus hederae,
Schmidt. Mount Edgcumbe (Keys) ; Launceston Phloeophthorus
rhododactylus, Marsh. Marazion (Baily) Pityophthorus pubescens,
Marsh. Xylocleptes bispinus, Duft. Dryocaetes villosus, F. Pityogenes
bidentatus, Herbst Trypodendron domesticum, L. Mount Edgcumbe
Xyleborus dispar, F. In Czar plumtree, Launceston. Stylops melittae,
Kirby
The text on this page is estimated to be only 28.56%
accurate

INSECTS LEPIDOPTERA The Lepidoptera of the county have


always been a favourite study with the majority both of resident and
of visiting entomologists, and the workers in consequence have been
numerous. The earliest county lists are those of Dr. Cocks for
Falmouth and of Mr. William Noye for Penzance. Mr. J. J. Reading, in
his account of the Lepidoptera of the Plymouth district in the
Transactions of the Plymouth Institute for 1 86 1, included a number
of valuable data from the south-east of the county. In 1882 Mr. E. P.
Marquand published his 'Lepidoptera of West Cornwall ' in the
Transactions of the Penzance Natural History and Antiquarian
Society, and between 1884 and 1890 further contributions appeared
on the same subject and in the same Transactions by Mr. E. A.
Atmore, Mr. A. H. Jenkin, Mr. H. W. Vivian, and Messrs. J. C. and C.
W. Dale. The Lepidoptera of Scilly attracted the attention of Mr. R.
Adkin, the Rev. H. Harpur Crewe, Mr. F. Jenkinson, and Mr. F.
Norgate, while Mr. H. Jenner Fust published some interesting records
for the mainland. Then in the Transactions of the Penzance Natural
History and Antiquarian Society for 1894 Mr. W. E. Baily, in a paper
entitled ' Lepidoptera of Cornwall and of the Islands of Scilly,'
summed up practically all the work of previous writers, added many
observations of his own, and incorporated the data supplied in MS.
by the Rev. T. A. Marshall for East Cornwall, by Mr. R. V. Tellam for
the country round Bodmin, and by the Messrs. Marquand for the
Penzance district, along with some notes sent in by Mr. A. Rashleigh
and Mr. F. Jenkinson. In the preparation of the accompanying list the
writer wishes to express his indebtedness to the late Mr. W. E. Baily
and to the late Rev. T. A. Marshall for many unpublished county
records, and to Mr. H. Goss for notes on north coast Lepidoptera. In
addition to much admirable work by his pupils he further gratefully
acknowledges annotated lists from the Rev. G. Lupton Allen for
Millook and for Launceston ; from Mr. A. Kenelm Peter for the
country round Poundstock ; from the late Mr. G. Marryat for Looe ;
from that prince of collectors, Mr. R. V. Tellam, for MidCornwall ;
from his colleague Mr. W. A. Rollason for the Truro district ; and from
Mr. A. J. Spiller for Godolphin. Specimens and notes have also been
kindly given to the writer or placed at his disposal by many county
observers, chief among whom are Mr. J. D. Enys and Mr. Howard
Fox. The classification and arrangement of the moths is that of Mr.
Edward Meyrick in his Handbook of British Lepidoptera.
RHOPALOCERA The Swallow-tail (Papilio machaon) is not a native,
but various attempts have been made to establish it in the county.
Noye, Baily, and others have at different times set freshly-emerged
specimens at liberty, and turned down pupae, but in all cases the
insects have quickly disappeared. On 5 August, 1 905, Howard Fox
saw one crossing Trebah beach on the Helford River, probably a
specimen accidentally introduced. Sir Charles Lemon reported an
example of Parnassius apollo captured near one of his greenhouses
at Carclew, but suggested it had been introduced in the pupa stage
in a batch of plants from the Continent. Of the Black-veined White
(Aporla crataegi) two specimens were recorded by F. H. Davey from
the Falmouth district. One of these, fresh but mutilated, was brought
to him by the captor in 1892 from the valley of the Kennall, near
Ponsanooth ; the other, taken in the St. Mawes district, he found in a
local collection in 1894. The Large and Small Cabbage Whites (Pieris
brassicae and P. rapae) are abundant throughout the county, and
occasionally do considerable damage to the different members of
the cabbage family. In 1899 some Honesty grown for the market
near Penzance was much disfigured, and a quantity of seedling
wallflowers practically destroyed, by P. brassicae. Early in September,
1891, an immense cloud of this species came in near the Lizard, and
for the next day or two, hundreds of thousands of dead insects were
washed up on the beach. The Green-veined White (P. napi) is
common on the whole, though in some districts it is rather scarce. It
never occurs in such quantities as to be a serious pest, the only
mischief attributed to it during the last six years being the partial
destruction of a crop of watercress near Bodmin in 1900. The
beautiful Orange-tip (Anthocaris cardamines) is usually very
common, but for some years females have been unaccountably
scarce. Though usually single-brooded, specimens of a second
emergence were seen and captured by Baily on 28 August, 1897, at
Marazion. The larvae feed on cruciferae, and especially on the seed
pods. In 1900 it attacked the pods of some seeding broccoli at
Penzance, and in 1902 did some damage to seeding Brompton
Stocks at Liskeard. The delicate Wood White (Leucophasia sinapis) is
in most seasons not uncommon in the sheltered partly-wooded
valley of Millook, near Bude, and in the adjoining copses. It was
obtained near Launceston over forty years ago by Reading, and has
been recently taken in that neighbourhood by 203
The text on this page is estimated to be only 28.53%
accurate

A HISTORY OF CORNWALL Rollason and others. It occurs


somewhat sparingly on the edge of woods round Bodmin. A single
specimen at Doublebois in 1900 and one near Looe in 1902 are the
only other trustworthy records to hand. The Pale Clouded Yellow
(Co/ias hyale] is variable in its occurrence, but is always rare, and
many years may pass without a single specimen being recorded for
the county. It was taken at Whitsand Bay east in 1857 and again in
1892, when several were captured at Saltash. One was captured
that same year in the vale of the Kennal, near Ponsanooth, and
several by Baily near St. Burian in the Land's End district. In 1900,
the year of the great invasion in the eastern counties, it was taken
near the mouth of the Seaton River and on Budock Bottoms. At least
two have been taken in the Bude district, several about Lostwithiel,
two at Falmouth, one at the Lizard, and one at Marazion. The
Clouded Yellow (Co/ias edusa) is in some years abundant, in others
seldom seen, and has been recorded from almost every district in
the county. In 1877 'lt was ln some localities extraordinarily
abundant. In 1892 it was much more widely spread, but evidently
nowhere plentiful, at least west of Par. In 1897 it was very common
about Godolphin, Spiller taking forty one morning on Praa Green. In
1899 it was again abundant on the clover fields about Godolphin,
and in 1900 it occurred in great numbers from Truro westwards.
Near Falmouth that year it literally swarmed during the last week of
August and the first week of September. The female variety, helice,
together with intermediate forms, occurred sparingly with the type,
Rollason taking eleven specimens, all in perfect condition, freshly
emerged, and on several occasions before their wings were perfectly
dried, and yet in spite of careful search he failed to find any pupa
cases either of this or of the type. Writing in 1893, Baily says that
the Brimstone (Gonepteryx rhamnt) was plentiful in the east of the
county, but grew rapidly scarce towards the west, and that it had
never been found beyond Penzance. Nowadays it is not only
common about Truro, but is plentiful as far west as Godolphin, and is
by no means rare in suitable localities in the Land's End peninsula.
The Small Pearl-bordered Fritillary (Argynnis selene) is a somewhat
local species, but widely distributed and in places common. Its
headquarters in the county seem to be St. Martin's Wood, Looe,
where some years it is abundant. It is usually fairly plentiful on
Millook Common and about Poundstock, and occurs in favoured
spots along the southern half of the county, but is rare west of
Helford and in the district of the Lizard. The Pearl-bordered Fritillary
(A. euphrosyne) is also somewhat local, and its county distribution
seems to be practically identical with that of the previous species.
About Truro it is in most years decidedly commoner, but has not
been recorded from the Lizard district at all. The Dark Green Fritillary
(A. aglaia) is common in most years along the north coast from
HennaclifF to Tintagel, at Newquay, Perranporth, and St. Agnes. It
often occurs plentifully here and there on the moors. In 1900 it was
common near Cardinham, in 1902 at Trebartha, and some years ago
was taken in considerable numbers near Liskeard. In the southern
half of the county it is much more local than the two preceding
species, and does not seem to have been taken in the Truro district
at all. Spiller says it is very rare north of Helston, but common at the
Lizard. The High Brown Fritillary (A. adippe) is apparently very local.
It occurs not unfrequently in the valley at Millook, and from there
sparingly to Wainhouse Corner (Goss). It is also recorded from the
large woods in the east of the county, and appears to be common
some years about Doublebois and Bodmin. From Truro westwards it
is a rare casual. The Silver-washed Fritillary (A. paphia) is in some
years fairly common in the Millook district and in the woods by the
Tamar. It is frequently recorded along the southern half of the
county. In the west its headquarters are at Trevarno Wood, Sithney.
It is also common in a little wood at Cury Cross to the south of
Helston. The Greasy Fritillary (Melitaea aurinta) is very local, and
does not seem to be common anywhere in the county. It occurs
sparingly in places on the Lynher, and is not infrequent on a hill near
the Cheesewring, where, according to Bignell, the specimens are
much brighter in colour than those from the south of Devonshire. It
has been taken near Looe, once by Tellam in the north of Bodmin,
twice near Wadebridge, and once by Rollason near St. Austell. The
Pearl-bordered Likeness or Heath Fritillary (M. athalia) is at times
abundant at St. Martin's Wood, near Looe, but seems to be scarce
elsewhere. On I July, 1902, five or six were seen on Per/mica
chamaedrys in a clearing in the American garden at Trebartha. It has
been found occasionally in the southern half of the county as far
west as Par, but is probably commoner than it seems to be, as it
varies its haunt from year to year. It has been once reported from
the neighbourhood of Falmouth. The Large Tortoise-shell (Fanessa
polychloros) is evidently nowhere common in the county, but is
taken occasionally all along the south from Mount Edgcumbe to Paul
and St. Burian, near the Land's End. In the Poundstock district two
or three specimens are taken almost every year, and it has also
occurred at Mawgan and at Newquay. The Small Tortoise-shell (F,
urticae) is abundant all over the county and at Scilly from early
spring till late autumn. Specimens have been not infrequently seen
in December and January. Spiller has reared a thousand Cornish-laid
specimens yearly at Godolphin for three years, and from 204
The text on this page is estimated to be only 28.54%
accurate

INSECTS among them has obtained all forms recorded in


Newman, including the form approaching ichnusa, the banded form
approaching the Japanese connexa, and the remarkable abnormal
form No. 3. The Peacock (V. to) is common throughout the county
and in some years is locally very abundant. It varies much in size. At
one particular spot in the Liskeard district a very small form has
been taken four seasons out of the last five which Staudinger
accepted as the variety iaides. Spiller has taken an aberration at
Godolphin with the right fore-wing fawn-coloured. The Camberwell
Beauty (V. antiopa] has been twice taken in the county. In the
beginning of June, 1832, F. Holmes, Oxford, captured a weather-
beaten specimen at Tregothnan, details of which will be found in the
first volume of The Ibis. On 2 January, 1901, T. J. Porter of Hayle,
when out shooting on Higher Spargo in Mabe, caught a fine
specimen with his cap in the field called Sunny Corner. Charles Fox
of Trebah, in the adjoining parish of Constantine, saw a Camberwell
Beauty in his grounds many years ago, and another appears to have
been seen in the valley of the Fowey above Lostwithiel. The Red
Admiral (V. atalanta) is common and generally distributed save on
the moorland. In some autumns it is locally most abundant. In the
first week of October, 1902, there must have been over four hundred
at one time in a neglected orchard near Callington. This glorious
sight lasted for several days. One calm sunny afternoon that same
autumn there were two or three hundred at the ivy blossom on
Launceston Castle. The fitful and erratic Painted Lady (A. carduii)
was plentiful over the greater part of the county up till a few years
ago, but lately has become scarce, at least in the south and west of
the county. In a good year it is still common about Poundstock and
Millook, and one rarely sees a clump of Hemp Agrimony without one
of these beautiful insects in attendance. In July, 1903, it was very
common on St. Mary's, Scilly. In 1894 Spiller found several hundreds
at Tremearne Cliffs that had just arrived from the south-east, with a
few stragglers still coming in from the sea. They had a washed-out
appearance and were much exhausted, as they allowed themselves
to be picked up off the grass without resistance. They seemed to
rest as well on the water as on land. Of the three authenticated
specimens of the American F. huntera captured in England, one in
beautiful condition was taken by Miss C. L. Pole-Carew on 20
September, 1876, at Antony, near Tor Point, and recorded by Bignell
in The Entomologist, ix, 255. There is no doubt it was an accidental
introduction. The White Admiral (Limenitis sybil/a) appears to have
been common at Godolphin early last century; but R. James, writing
from Penzance to W. P. Cocks of Falmouth in 1849, says he had not
seen one for nearly twenty years. The capture of two specimens of
Danais archippus in the south of England in 1876 drew the attention
of most entomologists to the extraordinary world-wide immigration
of this American species. On 21 September, 1885, R. J. Anderson
saw two and captured one at Trevilley, near the Land's End
(Entomologist, xviii, 290). On 17, 24, and 29 of the same month A.
H. Jenkin took three and saw a fourth near the Lizard, and Miss
Rogers captured one at Penzance a few days later in the same year.
In August, 1886, one was taken at the Lizard. Since that date no
further occurrences have been recorded for the county, and the last
appearance of the insect in England was in October, 1890. There
seems to be no doubt that the specimens taken were all genuine
emigrants and not cases of 'assisted passage.' The occurrence of the
Purple Emperor (Apatura iris) in the county rests on its reputed
capture by a railway official near Bodmin some years ago, but the
writer has not been able to trace either captor or specimen. The
Marbled White (Melanargia galatea) is confined to very restricted
areas within which it is in some seasons common. It has been
established in Werrington Park, Launceston, for at least fifty years,
and in 1901 was unusually plentiful there. Bignell found it at
Penhale, Egloskerry, in 1882, and it was taken there in 1899. At one
particular spot on the Trebartha estate it is in most years quite
common. In and about 1875 there was a flourishing colony at
Trerice, Newlyn East, but it entirely disappeared many years ago,
though two examples were captured in the valley , of the Gannel in
1902. This appears to have been its most westerly settlement in the
county. Stray specimens have at long intervals been recorded from
the south of the county from St. Germans to Par, and in 1905 a sadly
battered female was taken near Falmouth. The Speckled Wood
(Pararge egeria) is common and in many places abundant
throughout the county except on the moors. It is plentiful in almost
every shady lane and round the shaded margins of most of the
woods in the east and middle, and more generally diffused in the
west. It does not seem to have been previously recorded from Scilly,
but was taken on a wall near Great Grimsby, Tresco, in April, 1903.
There are three and occasionally four emergences in the year, the
first brood frequently appearing about Godolphin and Penzance
before the end of March. The sun-loving Wall (P. megaera) is
common all over the county, and is the roadside butterfly par
excellence. The sunny side of the Cornish hedgebanks suits it
admirably, and it is often plentiful on warm dry grass, on sheltered
sunny hillsides, and around protected coves on 205
The text on this page is estimated to be only 28.57%
accurate

A HISTORY OF CORNWALL the south coast. At present it


does not appear to be so abundant as it was fifteen years ago.
Spiller says that about Godolphin it is triple-brooded in most years,
the emergences occurring in early May, in July, and in October. The
Grayling (Satyrus semeli) is abundant on the high heath land, the
commons, and the sunnyparts of the cliff from Morwinstow to
Dizzard Head, and common on most of the heath and dry waste land
of the county generally. On sheltered broken cliff land on the south
coast it is often present in great numbers, but sits so close baking
itself in the sun that it might easily be overlooked. The Large
Meadow Brown (Epinephile janira) is abundant both on the mainland
and at Scilly. Very small specimens are occasionally taken about
Ludgvan and Gulval in the third and fourth week in August in
perfectly fresh condition, which Barrett thought probably belonged
to a partial second brood. Many of the Scillonian specimens are
richer in colour and more velvety in texture than the type. Bleached
forms and varieties with extra ocelli on the upper wings are taken by
Spiller every year at Godolphin. The Small Meadow Brown (E.
tithonus) shows a marked affection for a Cornish hedgebank covered
with a tangle of bramble canes. It is common and widely distributed
over the county, but is neither so general nor so abundant as the
preceding species. Bleached examples and varieties with bi- and tri-
pupilled ocelli occur at Godolphin, and in 1903 Spiller took a melanic
form there with two extra ocelli. The Wood Ringlet (E. hyperanthes)
is local, but fairly common. About Poundstock and Millook it is
usually common on the shady side of the taller hedgebanks and
among the woods ; and for several years has been plentiful in one
particular haunt in the valley of the Gannel. In 1902 it was abundant
near the bottom of the Cascade Wood, Trebartha, and round the
upper pond. It occurs on the banks of the Tamar and the Lynher,
and in colonies along the southern half of the county as far west as
Falmouth. Casual specimens have been taken in the Land's End
district. The Small Heath (Coenonympha pamphilus) is common and
generally distributed throughout the east and north-east of the
county, fairly common in the middle, and local in the west. The
Brown Hairstreak (Thecla betulae) has been taken twice and seen
occasionally by the Rev. G. Lupton Allen at Millook, and A. K. Peter
describes it as fairly common some years about Poundstock. At least
three single specimens have been captured around Bude and one at
Kilkhampton. Two were obtained at Trebartha in 1902, and it has
been taken in the valley of the Lynher. The Green Hairstreak (T.
rub'i) is fairly common but local in the east, somewhat scarce as a
rule in the middle, and rare in the west of the county. In good years
it is of frequent occurrence about Millook and Launceston, in 1902 it
was common at Trebartha, and is often taken at Saltash and
Whitsand Bay East. It was fairly common in 1901 near Liskeard and
Looe, plentiful in 1903 about Boscastle, and was taken at Lostwithiel
and at Bodmin. Rollason reports it from Polperro and Truro, and Miss
Snell has sent in specimens from St. Agnes. Spiller has taken two
specimens at Godolphin, Marquand one near Penzance, and Mrs.
Clark one at Hayle. The Purple Hairstreak (T. quercus) is common
and locally abundant in the east of the county and about Millook, is
not infrequently taken about Liskeard and Bodmin, but is scarce
further west. It has been recorded by Rollason from St. Austell and
Burngullow, and by Spiller round the oaks at Godolphin, but has not
been found in the Penzance district. The Small Copper (Polyommatus
phlocai) is common and generally distributed throughout the county.
It is in some seasons remarkably abundant in places along the south
coast. Silvery white, pale golden, and black varieties have been
found at various times, and Spiller chronicles one from Godolphin
with the left fore-wing quite white. The Silver-studded Blue (Lycaena
aegon) seems to be practically restricted to the western half of the
county. It is locally not uncommon on the moorlands of the Land's
End country, is common on all the heaths and downs of the Lizard
peninsula and of the Breage and Sithney parishes, is not infrequently
obtained most seasons about Falmouth and Truro, and occurs
regularly at Perranporth. Only occasional specimens have been
recorded east of Burngullow, chiefly from Looe and Whitsand Bay.
The females vary much in colour, some being almost
indistinguishable from L. minima, while others show a great deal of
blue. The Brown Argus (L. astrarche) is local and apparently
nowhere common in the county. It has been taken at Perranporth,
Mithian, and for the last three years at Carbis Bay. In the south it
appears to be commonest at Praa Green, but has been taken
occasionally at Godolphin and once or twice about Penzance.
Reading found it in the extreme east of the county nearly fifty years
ago, but there is no recent record. The Common Blue (L. icarus) is
generally distributed, and in most districts abundant, especially near
the sea. Colour variations are numerous. Though there is no chalk in
the county the Chalk Hill Blue (L. corydon) has been obtained
several times. Stephen Clogg found it tolerably abundant on the
railway banks near Terras, Pill, and other places.1 Baily reported the
occurrence of a single specimen at Paul, near Penzance ; and
Marryat took two near Whitsand Bay East. 1 Newman, British
Butterflies, 132. 206
The text on this page is estimated to be only 27.90%
accurate

INSECTS The Azure Blue (L. argiolus) occurs from


Kilkhampton and Whitsand Bay to Penzance. It is somewhat local,
but common, and in many places often abundant. The spring brood
is always the most plentiful, and in bad seasons the autumn brood
may not appear at all. In the wet August of 1903, for instance, not a
single specimen could be found in a favoured haunt near Newquay,
where hundreds had been seen the previous year. The discovery of
the Large Blue (L. arion) in abundance near Bude at the close of the
eighties by Messrs. Waterhouse was a subject of keen interest to
entomologists, as it had become extinct in its famous
Northamptonshire haunts nearly twenty years before, was supposed
to have died out on the Cotswolds, and had apparently disappeared
from the hills of the South Devon coast, near Bolt Head and
Kingsbridge. In some notes kindly sent by him to the writer of this
article, Goss says : — I first met with it in Cornwall, near Millook, a
few miles south-west of Bude, in the first week of July, 1902. It was
abundant in several localities between Bude and Boscastle from the
middle to the end of June, 1893, and I again met with it in various
localities on the north coast in June, 1896, and again in July, 1902.
In the latter year it had established itself in two or three new
localities, though its numbers near Millook had been reduced by the
enclosure and cultivation of many acres of common land and the
consequent destruction of its food plant [wild thyme]. In spite of
wholesale destruction at the hands of so-called entomologists the
species is still common in several localities, and is establishing new
colonies about Tintagel and beyond. The Small Blue (L. minima] has
been thrice recorded for the county, but in the first two cases the
voucher specimens proved to be colour variations of the female of L.
aegon. Last year two examples in perfect condition were obtained
near Saltash. The Duke of Burgundy (Nemeobius ludna) was
discovered in 1 900 in a sunny glade in one of the larger eastern
woods, and has occurred there sparingly every year since. This
appears to be its only haunt in the county. The Grizzled Skipper
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like