Click here to Skip to main content
11,581,982 members (74,798 online)
Click here to Skip to main content
Add your own
alternative version

Windows Mobile Password Safe

, 12 Jan 2009 CPOL 101.8K 2.6K 139
A password safe with a touch screen UI introducing Fluid Controls.
PasswordSafeExe.zip
Fluid.dll
passwords.pws
PasswordSafe.exe
PasswordSafeSource.zip
PasswordSafe
Fluditity
bin
Classes
vssver2.scc
Controls
enums
vssver2.scc
Events
vssver2.scc
Interfaces
vssver2.scc
vssver2.scc
Fluid.csproj.user
GdiPlus
mssccprj.scc
NativeMethods
vssver2.scc
vssver2.scc
Native
vssver2.scc
obj
Properties
vssver2.scc
vssver2.scc
PasswordSafe
bin
Release
Fluid.dll
passwords.pws
PasswordSafe.exe
Classes
vssver2.scc
Encryption
vssver2.scc
EventArgs
vssver2.scc
ListBoxes
vssver2.scc
PasswordSafe.csproj.user
Properties
vssver2.scc
Resources
lock.bmp
minus.png
props.bmp
save.bmp
saved.bmp
search.bmp
searchd.bmp
undo24.bmp
undo24_d.bmp
Untitled.png
vssver2.scc
security.ico
Templates
vssver2.scc
Themes
vssver2.scc
vssver2.scc
Xml
vssver2.scc
vssver2.scc
using System;
using System.Collections.Generic;
using System.Text;
using Color = System.Drawing.Color;

namespace Fluid.Drawing.GdiPlus
{
    public class ImageAttributesPlus
    {
        public ImageAttributesPlus()
        {
            nativeImageAttr = new GpImageAttributes();
            lastResult = GdiPlus.GdipCreateImageAttributes(out nativeImageAttr);
        }

        ~ImageAttributesPlus()
        {
            GdiPlus.GdipDisposeImageAttributes(nativeImageAttr);
        }

        ImageAttributesPlus Clone()
        {
            GpImageAttributes clone;

            SetStatus(GdiPlus.GdipCloneImageAttributes(
                                                nativeImageAttr,
                                                out clone));

            return new ImageAttributesPlus(clone, lastResult);
        }

        GpStatus SetToIdentity(ColorAdjustType type)
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesToIdentity(nativeImageAttr, type));
        }

        GpStatus Reset(ColorAdjustType type )
        {
            return SetStatus(GdiPlus.GdipResetImageAttributes(nativeImageAttr,type));
        }

        //Status
        //SetColorMatrix(
        //     ColorMatrix colorMatrix,
        //    ColorMatrixFlags mode = ColorMatrixFlagsDefault,
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesColorMatrix(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        true,
        //                                        colorMatrix,
        //                                        null,
        //                                        mode));
        //}

        //Status ClearColorMatrix(
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesColorMatrix(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        false,
        //                                        null,
        //                                        null,
        //                                        ColorMatrixFlagsDefault));
        //}

        //Status
        //SetColorMatrices(
        //     ColorMatrix *colorMatrix,
        //     ColorMatrix *grayMatrix,
        //    ColorMatrixFlags mode = ColorMatrixFlagsDefault,
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesColorMatrix(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        true,
        //                                        colorMatrix,
        //                                        grayMatrix,
        //                                        mode));
        //}

        //Status ClearColorMatrices(
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesColorMatrix(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        false,
        //                                        null,
        //                                        null,
        //                                        ColorMatrixFlagsDefault));
        //}

        //Status SetThreshold(
        //    float threshold,
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesThreshold(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        true,
        //                                        threshold));
        //}

        //Status ClearThreshold(
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesThreshold(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        false,
        //                                        0.0));
        //}

        public GpStatus SetGamma( float gamma,ColorAdjustType type)
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesGamma(
                                                nativeImageAttr,
                                                type,
                                                true,
                                                gamma));
        }

        public GpStatus ClearGamma(
            ColorAdjustType type
            )
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesGamma(
                                                nativeImageAttr,
                                                type,
                                                false,
                                                0.0f));
        }

        public GpStatus SetNoOp(
            ColorAdjustType type
            )
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesNoOp(
                                                nativeImageAttr,
                                                type,
                                                true));
        }

        public GpStatus ClearNoOp(
            ColorAdjustType type
            )
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesNoOp(
                                                nativeImageAttr,
                                                type,
                                                false));
        }

        public GpStatus SetColorKey(
             Color colorLow,
             Color colorHigh,
            ColorAdjustType type
            )
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesColorKeys(
                                                nativeImageAttr,
                                                type,
                                                true,
                                                colorLow.ToArgb(),
                                                colorHigh.ToArgb()));
        }

        public GpStatus ClearColorKey(
            ColorAdjustType type
            )
        {
            return SetStatus(GdiPlus.GdipSetImageAttributesColorKeys(
                                                nativeImageAttr,
                                                type,
                                                false,
                                                0,
                                                0));
        }

        //Status SetOutputChannel(
        //    ColorChannelFlags channelFlags,
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesOutputChannel(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        true,
        //                                        channelFlags));
        //}

        //Status ClearOutputChannel(
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesOutputChannel(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        false,
        //                                        ColorChannelFlagsLast));
        //}

        //Status SetOutputChannelColorProfile(
        //     WCHAR *colorProfileFilename,
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesOutputChannelColorProfile(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        true,
        //                                        colorProfileFilename));
        //}

        //Status ClearOutputChannelColorProfile(
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesOutputChannelColorProfile(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        false,
        //                                        null));
        //}

        //Status SetRemapTable(
        //    UINT mapSize, 
        //     ColorMap *map,
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesRemapTable(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        true,
        //                                        mapSize,
        //                                        map));
        //}

        //Status ClearRemapTable(
        //    ColorAdjustType type = ColorAdjustTypeDefault
        //    )
        //{
        //    return SetStatus(NativeMethods.GdipSetImageAttributesRemapTable(
        //                                        nativeImageAttr,
        //                                        type,
        //                                        false,
        //                                        0,
        //                                        null));
        //}

        //Status SetBrushRemapTable(UINT mapSize, 
        //                           ColorMap *map)
        //{
        //    return this.SetRemapTable(mapSize, map, ColorAdjustTypeBrush);
        //}

        //Status ClearBrushRemapTable()
        //{
        //    return this.ClearRemapTable(ColorAdjustTypeBrush);
        //}

        //Status SetWrapMode(WrapMode wrap, 
        //                    Color& color = Color(), 
        //                   BOOL clamp = false) 
        //{
        //    ARGB argb = color.ToArgb();

        //    return SetStatus(NativeMethods.GdipSetImageAttributesWrapMode(
        //                       nativeImageAttr, wrap, argb, clamp));
        //}

        //// The flags of the palette are ignored.

        //Status GetAdjustedPalette(OUT ColorPalette* colorPalette,
        //                          ColorAdjustType colorAdjustType)  
        //{
        //    return SetStatus(NativeMethods.GdipGetImageAttributesAdjustedPalette(
        //                       nativeImageAttr, colorPalette, colorAdjustType));
        //}

        GpStatus GetLastStatus()
        {
            GpStatus lastStatus = lastResult;
            lastResult = GpStatus.Ok;

            return lastStatus;
        }



        internal ImageAttributesPlus(GpImageAttributes imageAttr, GpStatus status)
        {
            SetNativeImageAttr(imageAttr);
            lastResult = status;
        }

        internal void SetNativeImageAttr(GpImageAttributes nativeImageAttr)
        {
            this.nativeImageAttr = nativeImageAttr;
        }

        GpStatus SetStatus(GpStatus status)
        {
            if (status != GpStatus.Ok)
                return (lastResult = status);
            else
                return status;
        }


        internal GpImageAttributes nativeImageAttr;
        private GpStatus lastResult;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Thomas Gerber
Software Developer (Senior)
Germany Germany
MCPD
Enterprise Application Developer 3.5
Windows Developer 3.5
.ASP.NET Developer 3.5
.NET 2.0 Windows Developer
.NET 2.0 Web Developer
.NET 2.0 Enterprise Application Developer


MCTS
.NET 3.5 Windows Forms Applications
.NET 3.5 ASP.NET Applications
.NET 3.5, ADO.NET Application Development
.NET 3.5 WCF
.NET 3.5 WPF
.NET 3.5 WF
Microsoft SQL Server 2008, Database Development
.NET 2.0 Windows Applications
.NET 2.0 Web Applications
.NET 2.0 Distributed Applications
SQL Server 2005
Sharepoint Services 3.0 Application Development
Windows Vista Client Configuration

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150603.1 | Last Updated 12 Jan 2009
Article Copyright 2009 by Thomas Gerber
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid