.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

richtextbox image problem

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Windows Application
 
can i paste more than 1 pic/image to richtextbox and then select specific image such as index or another way?
 if (File.Exists(fileName))
        {

          Image img = Image.FromFile(fileName);
          img = resizeImage(img);


          Clipboard.SetImage(img);
          img.Dispose();
          img = null;
          rtb.SelectionStart = 0;
          
          rtb.Paste();

          Clipboard.Clear();
        }
can i paste 2 picture from two file path into same richtextbox and how to select one picture each time from the above code


View Complete Post


More Related Resource Links

datalist image slide show problem

  

hi friends


i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />
    </div>


I above code works perfectly and the slide show e

Session problem with display of image in row of reportviewer

  

Hello techies...

I am new to this sql reporting service. But anyhow by surfing I am able to bind the report but i was stuck in image display.

Anyways, i also managed that. But the real problem is whenever i was keeping a image control in rdlc report i was having session prob. If i remove the image control then as usual report works fine.

Please suggest me some solution.... either for session problem or for image display. I am keeping the image name in database but for binding the rdlc report i am using a store procedure which return the path (static) concating with the image name(kept in database).

Hope to find a solution .....


Problem with passing an Image as binary through web service

  

All

I have a web service that is accessed by a windows forms application and receives updates like facility name, address, image etc. Everything works fine except the image data is not being passed to the windows app. I am saving the images in database on both sides, so when I pull it from the server I use the following code

if (!reader.IsDBNull(floorPlanOrdinal))

facility.FloorPlan = (byte[])reader["FloorPlan"];

I can see the facility.FloorPlan Dimentions as 103840 when I debug this method which means that the data is pulled from the database fine.

On the forms side though the dimentions become 0, all other values pass fine except this. Here is the facility property in the web service on server side.

using System;

using System

grid view image delete problem

  
i have a grid in which i am showing a record with image, when user delete the record the image also deleted and when it again enter the record it upload the new image but display the deleted image from the cache example: name.jpeg upload, then deleted, a different file with the name.jpeg upload, it showing the deleted one. 

Problem when Append DataFormats.xamlPackage RichTextBox

  
public partial class Window12 : Window { public Window12() { InitializeComponent(); } FileStream fStream; private void btnClick_Click(object sender, RoutedEventArgs e) { TextRange ran = new TextRange(txtMsg.Document.ContentStart, txtMsg.Document.ContentEnd); ran.Save(fStream, DataFormats.XamlPackage); txtMsg.Document.Blocks.Clear(); txtMsg.Focus(); } private void Window_Loaded(object sender, RoutedEventArgs e) { string fileName = @"D:\\part1.xaml"; if (File.Exists(fileName)) fStream = new FileStream(fileName, FileMode.Append, FileAccess.Write); else fStream = new FileStream(fileName, FileMode.Create); txtMsg.Focus(); } private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { fStream.Close(); } } Hi, I have WPF RichTextbox and a button When I insert the text or Image and Click the button the text will save in D: drive with DataFormats.XamlPackage Initially it works fine, when I try to append the text (Close window and open again then insert the text )It gives the error in range.Save(fStream,DataFormats.XamlPackage); Error Message:Cannot open package because FileMode or FileAccess value is not valid for the stream.am

image caching problem in internet explorer

  
i have built a custon aps.net image controls, which currently refresh the image via javascript and ajax.in firefox, google chrome,.. it works perfectly, but (suprise), there is problem in internet explorer 6 and 7. IE didn't relase the old (previous) image, so all images will be saved in the cache and ram consumption of the browser rises until it crashes...the javascript code:function getNextImage(clientId) { if (busy) { window.setTimeout("getNextImage('" + clientId + "')", 100); return false; } busy = true; //Send the request to server with the current image url as the argument var element = document.getElementById(clientId); var func = "CallServer(" + element.src + ", '')"; var sor = element.src; func = "CallServer" + clientId + "('" + sor + "', '')"; window.setTimeout(func, 0); } function ReceiveServerData(rValue) { //Receive server's response of a string rValue, which is prepared in the server's function //GetCallbackResult() var wds = rValue.split(";"); //Assign the transition effect var photo = document.getElementById(wds[0]); photo.style.filter = wds[2]; //Preload the image file from server. When finishing download, imageLoaded function will be called //with t

image flickering problem on css togle

  

Hi,

I am trying to use and modify this sample by WebDesignerWall.

What i've done is add a litle JavaScript to togle the visibility of pin. The pin will be clickable.


problem: The left image works like a charm. The right one is the problem. When you try to click the pin and position the cursor in upper half of the pin, just outside the bounds of div then the pin starts to flicker. How to bypass that? Maybe with JavaScript event fireing just once, how? I'm also opened to other solutions of achieving the same efect.

p.s.: At the end i will be using Obout's ImageZoom instead of <img>.


the sample (copy/paste and it will work, images are linked dir. to web)

<head runat="server">
    <title></title>
    <style type="text/css">
        .photo
        {
            margin: 30px;
            position: relative;
            width: 180px;
            height: 130px;
            float: left;
        }
        .photo img
        {
            background: #fff;
            

Reporting Services Chart in SharePoint Web Part, Broken Image Problem

  
Hi,
I have a reporting services report that displays a dundas chart, it is a snapshot report executed daily.  When displaying the report inside a page viewer webpart or a report viewer web part in SharePoint, the first time after a recent snapshot occurs, the image shows up broken.  On refresh of the page the image is visible.

MOSS 2007
SQL Server 2005 Reporting Services NOT running in SharePoint Integration mode.

Any ideas or work arounds to get the image to display on the first load of the page or why the image is broken?  I've tried different report parameters, Format, ClearSesson with no luck.  Viewing the report in Report Manager works fine and also going directly to the ReportServer page is fine.  It only occurs when it's inside of SharePoint inside of the Page Viewer or Report Viewer web parts or even if I manually create an iframe in a content editor web part.

Thanks!

Image Refresh problem

  
Hi

Im quite new to WPF and I'm stuck with an refresh issue.
The scene is as follows:

1) I have a form with an image on it.
2) A screenshot is made, and saved to the above mentioned image. (from the app)
3) The image should be refreshed to show the new image (but same file)

However I can not get it to work.
I can see the file is changing on the disk (viewing it and timestamp) and even in the WPF designer the image changes, but not in the running app :-/

I don't know what wrong. (other than the image does not refresh). So can anyone help?
My code is as follows:

XAML:

<Window x:Class="Imagetest.Window1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Title

Binary Data Problem....save and retrive image data from sql database

  

hello friends...please help me to solve this problem....

i have created crud (create, retive, update and delete)form and it's running... here i want to add images for each record(sql database)....

i'm using image datatype in sql table for picture.....

Q 1: how to save and retrive binary data(image) from sql table in asp.net form using vb coding?

Q2: can i create sql table which store binary(image url) data direct?

thank you


Interesting Problem WPF Visual to Image Convert.

  

I am converting the Canvas to Image By using

renderBitmap = new RenderTargetBitmap(desiredWidth, desiredHeight, 96d, 96d, PixelFormats.Pbgra32);// PixelFormats.Pbgra32);
                    //RenderOptions.SetEdgeMode(drawingVisual, EdgeMode.Aliased);
                    RenderOptions.SetBitmapScalingMode(drawingVisual, BitmapScalingMode.HighQuality );
                    drawingVisual.SnapsToDevicePixels = true;
                    var dv = new DrawingVisual();
                    using (DrawingContext ctx = dv.RenderOpen())
                    {

                        var vb = new VisualBrush(drawingVisual);
                &nbs

problem with XamlReader Load/Parse image

  

I got error with this below:

string imageCompXaml = serialized image (bitmap)

Image imgObj = XamlReader.Parse(imageCompXaml) as Image

err: Property 'UriSource' or property 'StreamSource' must be set

i can workaround the problem by

  imgObj = new Image();
  imgObj.BeginInit();
  imgObj.Source = BitmapImageObject;
  imgObj.EndInit();

problem is by doing i missed out lot of other details.

I have a string, this is the serialized of the Image object, which is BitmapImage

I missed out the Image.prop details, like the width/height.

the image size is not same as the BitmapImage object, its a scaled/sized-down bitmap.

so using the 2nd Source workaround, i can't get back the actual image sizing (b4 serialize)

is there a way i can tackle at the XamlReader.Load/Parse() to resolve the err

or how to get back the image prop/details with my workaround?


Problem with Editing image inside DetailsView inside UpdatePanel

  

Hello,

I have a problem and I really hope you'll be able to help me.

I'm trying to add and edit an image which is located in a detailsview which is inside an UpdatePanel. After I read relevant topics in the forum I installed the Ajax Control Toolkit. Below is my source code. When I used it only for insert new image it worked great. The problem caused when I tried to implement it on the Edit mode, i.e. when I tried to edit the image and upload a different image.  Unfortunately it didn't work as I hoped. Nothing happend and the image hasn't been changed. I also tried to change the IDs (AsyncFileUpload ID) to be the same in both places but it didn't work either.

The source code:

<asp:DetailsView ID="dvMovie" runat="server" Height="50px" Width="695px"
                    AutoGenerateRows="False" DataSourceID="sdsMovieById"      
                     BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
                &

problem with XamlReader Load/Parse image

  

I got error with this below:

string imageCompXaml = serialized image (bitmap)

Image imgObj = XamlReader.Parse(imageCompXaml) as Image

err: Property 'UriSource' or property 'StreamSource' must be set

i can workaround the problem by

  imgObj = new Image();
  imgObj.BeginInit();
  imgObj.Source = BitmapImageObject;
  imgObj.EndInit();

problem is by doing i missed out lot of other details.

I have a string, this is the serialized of the Image object, which is BitmapImage

I missed out the Image.prop details, like the width/height.

the image size is not same as the BitmapImage object, its a scaled/sized-down bitmap.

so using the 2nd Source workaround, i can't get back the actual image sizing (b4 serialize)

is there a way i can tackle at the XamlReader.Load/Parse() to resolve the err

or how to get back the image prop/details with my workaround?


How to save WPF RichTextBox content (text + image) to the database

  

Hi

I want to save (and after that also to retrieve) the content of an WPF RichTextBox (text + image) to/from the database.

I found this: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/750a654e-b002-4742-8f46-609e93f6ec81 but like the author said, the solution seams not to work for text with image - the image is ignored/removed and only the formatted text is saved and after that retrieved to/from database.

Know someone a solution about this issue?

Best regards,

Vali

 

 

 


richtextbox problem

  
 private void pasteToRTB(string fileName,RichTextBox rtb)
    {
      try
      { 
        rtb.Text = "";
        if (File.Exists(fileName))
        {
          
          Image img = Image.FromFile(fileName);
          img = resizeImage(img);


          Clipboard.SetImage(img);  // <-- error at this line
          img.Dispose();
          img = null;
          rtb.SelectionStart = 0;
          rtb.Paste();

          Clipboard.Clear();
        }
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.Message + "__" + ex.StackTrace);
       
      }
    }

when i paste the file from picturebox to richtextbox....

it causes error at this line "Clipboard.SetImage(img);"
error message: Requested Clipboard operation didi not succeed, why???


iframe Loading Image show problem

  

i am  loading a ifrmae when we click a button .i am require a loadimage.show when i frame laoding time and disapper when i frame loaded


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend