Pages

Sunday, November 4, 2012

binary image insert using from c#


//Create Binary Data Stream  
    string filePath = Server.MapPath("filename");
    string filename = Path.GetFileName(filePath);
    FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
    BinaryReader br = new BinaryReader(fs);
    Byte[] bytes = br.ReadBytes((Int32)fs.Length);
    br.Close();
    fs.Close();

ASPxHTMLEditor resize toolbar


<ComponentArt:Splitter ID="Splitter1" runat="server" FillWidth="true" FillHeight="true"
        Height="1000px">
        <Content>
            <ComponentArt:SplitterPaneContent ID="ContentPane">
                <dxhe:ASPxHtmlEditor ID="Editor" runat="server" Height="700px" ClientInstanceName="ASPxHtmlEditor1">
                    <SettingsImageUpload>
                        <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png">
                        </ValidationSettings>
                    </SettingsImageUpload>
                </dxhe:ASPxHtmlEditor>
            </ComponentArt:SplitterPaneContent>
        </Content>
        <Layouts>
            <ComponentArt:SplitterLayout>
                <Panes Orientation="Horizontal" SplitterBarActiveCssClass="ActiveSplitterBar" SplitterBarWidth="5">
                    <ComponentArt:SplitterPane CssClass="SplitterPane ContentPane" PaneContentId="ContentPane" />
                </Panes>
            </ComponentArt:SplitterLayout>
            <ComponentArt:SplitterLayout ID="SplitterLayout1" runat="server">
            </ComponentArt:SplitterLayout>
        </Layouts>
        <ClientEvents>
            <ResizeEnd EventHandler="endResize" />
            <Load EventHandler="loadSplitter" />
        </ClientEvents>
    </ComponentArt:Splitter>
    <script type="text/javascript">
        function endResize() {
            ASPxHtmlEditor1.AdjustControl();
        }
        function loadSplitter() {
            ASPxHtmlEditor1.AdjustControl();
        }
    </script>