DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. HowTo: Store and Retrieve Images in a SQL CE Database on Windows Phone Mango

HowTo: Store and Retrieve Images in a SQL CE Database on Windows Phone Mango

John Esposito user avatar by
John Esposito
·
Nov. 02, 11 · Interview
Like (0)
Save
Tweet
Share
9.03K Views

Join the DZone community and get the full member experience.

Join For Free

Serious local database support is probably one of the coolest new features of Windows Phone 7.1(5).

For the Windows Phone developer, it's not hard to create a local database, or add some columns, indexes or tables.

But if you're using a SQL CE database then you are, after all, developing for a phone. And one of phones' most exciting powers isn't their hard drives -- it's their cameras.

And it turns out that Mango makes storing camera photos -- or any image data for that matter -- pretty easy.

To see how easy, look at this HowTo from Anton Swanevelder, posted a few days ago on his blog.

Anton breaks SQL CE image-storage into three steps (the CRU in CRUD), and every step takes less than 20 lines. For example, you can create a column to store image data like this:

[Column]
public byte[] ItemImage
{
get { return _ItemImage; }
set
{
if (_ItemImage != value)
{
_ItemImage = value;
NotifyPropertyChanging("ItemImage");
NotifyPropertyChanged("ItemImage");
}
}
}

The other two steps are more interesting (converting a camera stream to a storable byte array, then converting the byte array to a bitmap markup-able in XAML), but no more difficult.

Read the full post for the full implementation.

 

Database Windows Phone sql Mango (software)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Visual Network Mapping Your K8s Clusters To Assess Performance
  • Why Does DevOps Recommend Shift-Left Testing Principles?
  • Secrets Management
  • How To Validate Three Common Document Types in Python

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: