Tuesday, June 30, 2009

WPF : Hide Headers from a GridviewColumn

Hi,

I know, this is simple but I wasted a bunch of my valuable time in finding a solution while developing my first application in WPF. Include the following line in your < listview> block to get rid of headers in your gridview column.

< ListView.Resources>
< Style x:Key="CustomHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
< Setter Property="Visibility" Value="Collapsed" />
< /Style>
< /ListView.Resources>

Thanks,
Vikas

Friday, June 26, 2009

Reading Image Metadata Tags with Dot Net

Hi All,

I had to find a way to tag images and then use the tagged images to be searched with the help of tagged keywords. Example, if some images are tagged with the keywords "xxx", then searching for xxx should produce the image with xxx tag in the search results.

I tried with various document management software and all of these are actually very handy tools but they don't add metadata tags to images. Since we are spread all over the word, I thought it will be very often that the images will flow from one corner to other and the tags should flow along with the images. So the document management software approach ended with no benefit. Then I thought to develop a sample on my own.

There was one more reason for developing it. I wanted to search the images and provide a custom task ( eg, Inserting the image in powerpoint) which no software gives.

I download a free tagging software called ITag (Click here for Download). And tag all of images with various keywords using this software. It is really a good tool to add metadata tags.

Now when I added the tags, the following xml was added in the image (you can easily read the tags by editing the image files.)

< rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmpMM:InstanceID="uuid:02ab02d9-02d1-11da-9510-ec7226ba1889" xmpMM:DocumentID="adobe:docid:photoshop:02ab02d2-02d1-11da-9510-ec7226ba1889" tiff:ResolutionUnit="2" tiff:YResolution="72/1" tiff:XResolution="72/1" tiff:Orientation="1" tiff:NativeDigest="256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;F68680A2E9A53199A34ACB3FE0102FCA" xmp:ModifyDate="2005-08-01T17:16:48+05:30" xmp:CreatorTool="Adobe Photoshop 7.0" exif:PixelYDimension="227" exif:PixelXDimension="892" exif:ColorSpace="65535" exif:NativeDigest="36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;1064FAD10D9AAF6E380C481B30061C1D">

< dc:subject>< rdf:Bag xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">< rdf:li>Banking< /rdf:li>< rdf:li>Blinx< /rdf:li>< rdf:li>Burton< /rdf:li>< rdf:li>Wake up< /rdf:li>< /rdf:Bag>

< /dc:subject>< /rdf:Description>


Now the above XML suggests that the image is tagged with 4 tags (Wake up,Blinx,Banking,Burton).

After tagging, I run an indexing code and create a list of files with the tags. The produced output was like following :


< ?xml version="1.0" encoding="UTF-8"?>

< Files>

< File Name="imageName3.png">

< Keyword>Banking< /Keyword>
< Keyword>Sports< /Keyword>

< /File>

< File Name="imageName2.png">

< Keyword>Banking< /Keyword>
< Keyword>AssetManagement< /Keyword>
< Keyword>Sports< /Keyword>

< /File>

< File Name="imageName1.png">

< Keyword>Banking< /Keyword>
< Keyword>AssetManagement< /Keyword>
< Keyword>Sports< /Keyword>

< /File>
< /Files>


Now whenever user will enter a keyword in my search panel, I will just load the items from XML in the Panel and will display the images in a different thread.

HTH,
Vikas Bhandari

Wednesday, June 24, 2009

Use WPF User control to display in a Task Pane

Hi,

Use the following code in your Ribbon OnAction method to display a WPF User control in an office task pane:


Dim pane As WPFUserControlName= Nothing

If pane Is Nothing Then
Dim uControl As New UserControl()
Dim host As ElementHost = New ElementHost()

pane = New WPFUserControlName()

host.Child = pane
host.Dock = DockStyle.Left
host.Width = 200

uControl.Controls.Add(host)

taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(uControl, "Biographies")
taskPane.Visible = True
Else
taskPane.Visible = True
End If

Tuesday, June 23, 2009

Dot Net Color Codes

Hi All,

Please findbelow the dot net color codes. Source :Click here to go to Source Site


AliceBlueHex Code:#F0F8FF
AntiqueWhiteHex Code:#FAEBD7
AquaHex Code: #00FFFF
AquamarineHex Code: #7FFFD4
AzureHex Code: #F0FFFF
BeigeHex Code: #F5F5DC
BisqueHex Code: #FFE4C4
BlackHex Code: #000000
BlanchedAlmondHex Code: #FFEBCD
BlueHex Code: #0000FF
BlueVioletHex Code: #8A2BE2
BrownHex Code: #A52A2A
BurlyWoodHex Code: #DEB887
CadetBlueHex Code: #5F9EA0
ChartreuseHex Code: #7FFF00
ChocolateHex Code: #D2691E
CoralHex Code: #FF7F50
CornflowerBlueHex Code: #6495ED
CornsilkHex Code: #FFF8DC
CrimsonHex Code: #DC143C
CyanHex Code: #00FFFF
DarkBlueHex Code:#00008B
DarkCyanHex Code: #008B8B
DarkGoldenrodHex Code: #B8860B
DarkGrayHex Code: #A9A9A9
DarkGreenHex Code: #006400
DarkKhakiHex Code: #BDB76B
DarkMagentaHex Code: #8B008B
DarkOliveGreenHex Code: #556B2F
DarkOrangeHex Code: #FF8C00
DarkOrchidHex Code: #9932CC
DarkRedHex Code: #8B0000
DarkSalmonHex Code: #E9967A
DarkSeaGreenHex Code: #8FBC8B
DarkSlateBlueHex Code: #483D8B
DarkSlateGrayHex Code: #2F4F4F
DarkTurquoiseHex Code: #00CED1
DarkVioletHex Code: #9400D3
DeepPinkHex Code: #FF1493
DeepSkyBlueHex Code: #00BFFF
DimGrayHex Code: #696969
DodgerBlueHex Code: #1E90FF
FirebrickHex Code: #B22222
FloralWhiteHex Code: #FFFAF0
ForestGreenHex Code: #228B22
FuchsiaHex Code: #FF00FF
GainsboroHex Code: #DCDCDC
GhostWhiteHex Code: #F8F8FF
GoldHex Code: #FFD700
GoldenrodHex Code: #DAA520
GrayHex Code: #808080
GreenHex Code: #008000
GreenYellowHex Code: #ADFF2F
HoneydewHex Code: #F0FFF0
HotPinkHex Code: #FF69B4
IndianRedHex Code: #CD5C5C
IndigoHex Code: #4B0082
IvoryHex Code: #FFFFF0
KhakiHex Code: #F0E68C
LavenderHex Code: #E6E6FA
LavenderBlushHex Code: #FFF0F5
LawnGreenHex Code: #7CFC00
LemonChiffonHex Code: #FFFACD
LightBlueHex Code: #ADD8E6
LightCoralHex Code: #F08080
LightCyanHex Code: #E0FFFF
LightGoldenrodYellowHex Code: #FAFAD2
LightGrayHex Code: #D3D3D3
LightGreenHex Code: #90EE90
LightPinkHex Code: #FFB6C1
LightSalmonHex Code: #FFA07A
LightSeaGreenHex Code: #20B2AA
LightSkyBlueHex Code: #87CEFA
LightSlateGrayHex Code: #778899
LightSteelBlueHex Code: #B0C4DE
LightYellowHex Code: #FFFFE0
LimeHex Code: #00FF00
LimeGreenHex Code: #32CD32
LinenHex Code:#FAF0E6
MagentaHex Code: #FF00FF
MaroonHex Code: #800000
MediumAquamarineHex Code: #66CDAA
MediumBlueHex Code: #0000CD
MediumOrchidHex Code: #BA55D3
MediumPurpleHex Code: #9370DB
MediumSeaGreenHex Code: #3CB371
MediumSlateBlueHex Code: #7B68EE
MediumSpringGreenHex Code: #00FA9A
MediumTurquoiseHex Code: #48D1CC
MediumVioletRedHex Code: #C71585
MidnightBlueHex Code: #191970
MintCreamHex Code: #F5FFFA
MistyRoseHex Code: #FFE4E1
MoccasinHex Code: #FFE4B5
NavajoWhiteHex Code: #FFDEAD
NavyHex Code: #000080
OldLaceHex Code: #FDF5E6
OliveHex Code: #808000
OliveDrabHex Code: #6B8E23
OrangeHex Code:#FFA500
OrangeRedHex Code: #FF4500
OrchidHex Code: #DA70D6
PaleGoldenrodHex Code: #EEE8AA
PaleGreenHex Code: #98FB98
PaleTurquoiseHex Code: #AFEEEE
PaleVioletRedHex Code: #DB7093
PapayaWhipHex Code: #FFEFD5
PeachPuffHex Code: #FFDAB9
PeruHex Code: #CD853F
PinkHex Code: #FFC0CB
PlumHex Code: #DDA0DD
PowderBlueHex Code: #B0E0E6
PurpleHex Code: #800080
RedHex Code: #FF0000
RosyBrownHex Code: #BC8F8F
RoyalBlueHex Code: #4169E1
SaddleBrownHex Code: #8B4513
SalmonHex Code:#FA8072
SandyBrownHex Code: #F4A460
SeaGreenHex Code: #2E8B57
SeaShellHex Code: #FFF5EE
SiennaHex Code: #A0522D
SilverHex Code: #C0C0C0
SkyBlueHex Code: #87CEEB
SlateBlueHex Code: #6A5ACD
SlateGrayHex Code: #708090
SnowHex Code:#FFFAFA
SpringGreenHex Code: #00FF7F
SteelBlueHex Code: #4682B4
TanHex Code: #D2B48C
TealHex Code: #008080
ThistleHex Code: #D8BFD8
TomatoHex Code: #FF6347
TransparentHex Code:#FFFFFF
TurquoiseHex Code: #40E0D0
VioletHex Code: #EE82EE
WheatHex Code: #F5DEB3
WhiteHex Code: #FFFFFF
WhiteSmokeHex Code:#F5F5F5
YellowHex Code: #FFFF00
YellowGreenHex Code: #9ACD32


Thanks,
Vikas Bhandari