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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

create polyline size relative to image clicked

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :WPF


i am creating a path geometry using polyline:


 System.Windows.Point Point1 = new System.Windows.Point(50, 10);
      System.Windows.Point Point2 = new System.Windows.Point(200, 10);
      System.Windows.Point Point3 = new System.Windows.Point(200, 100);
      System.Windows.Point Point4 = new System.Windows.Point(10, 100);
      System.Windows.Point Point5 = new System.Windows.Point(10, 50);
      System.Windows.Point Point6 = new System.Windows.Point(50, 10);
      PointCollection polygonPoints = new PointCollection();
      yellowPolyline.Points = polygonPoints;

this is a rectangle which is clipped from top-left,

actually i want to create dynamically a polyline whose size is relative to the image i click on the canvas 

and then apply than clip that image using that polyline,,so that the image looks clipped from top-left

how can

View Complete Post

More Related Resource Links

Reduce Image Size


How to reduce the image weight using asp.net, without lose of image quality and image pixels. For example i have an image with the size of 4 MB (3024*2045), so how to reduce the image weight ie 4 MB to 1 MB without lose quality in the same pixels ie(3024 * 2045) using asp.net.

AsyncFileUpload: Throw Error on image size


I have an AsyncFilUpload that is used to upload  to my site. On the server side I have code that checks the width and height of the image and will only save the image if it is within the limits buit I can't figure out how to get the AsyncFileUpload control to show an error when this happens. Can anyone give me any pointers?


Get real image size in centimeters

Hi, Im new in c# , I have an image in picturebox and draw a line connecting within two coordinates points x1, y1 and x2, y2. I wonder if there is any way of calculating the size of the line in centimeters. If i can have an example i will thank. Thanks ..  ed

how to create a Bitmap with size(20000,30000) in c#

hi how to create a BitMap with size (20000,30000) using C#

size of dropped image

hi!! i have a drag and drop handle on a canvas which displays a image on canvas when dropped a file on it: private void DropHandle(object sender, System.Windows.DragEventArgs e) { string[] arrstrFileNames = e.Data.GetData(DataFormats.FileDrop, true) as string[]; if (first) { MenuItem mnu1 = new MenuItem(); mnu1.Header = "Rotate"; mnu1.Click += new RoutedEventHandler(Rotate_Click); MenuItem mnu2 = new MenuItem(); mnu2.Click += new RoutedEventHandler(Crop_Click); mnu2.Header = "Crop"; MenuItem mnu3 = new MenuItem(); mnu3.Header = "Delete"; mnu3.Click += new RoutedEventHandler(Delete_Click); mnu.Items.Add(mnu1); mnu.Items.Add(mnu2); mnu.Items.Add(mnu3); } if (arrstrFileNames == null || arrstrFileNames.Length < 1) return; try { BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = new Uri("file:///" + arrstrFileNames[0].Replace("\\", "/")); bmp.EndInit(); Image img = new Image(); img.Source = bmp; img.Width = 300; img.Height = 300; RotateTransform rt = new RotateTransform(); img.LayoutTransform = rt; if(first==true) img.ContextMenu = mnu; first = false; assig

What is the best way to dynamically create a scrollable list of forms that when clicked expand for e

Hello, What is the best way to dynamically create a scrollable list of forms that when clicked expand for entry? More details: In my XAML I have a TabControl. One particular TabItem looks like this:   <TabItem Name="Tab_Forms" Header="4" Width="50" Height="20" Background="{x:Null}" BorderBrush="{x:Null}"> <Border Name="Tab_CategoryTabSelected_Border" BorderThickness="10" BorderBrush="Transparent" Padding="3"> <... What do I use here? ...> </Border> </TabItem> At the location <... What do I use here? ...> I need some sort of scrollable control.  The scrollable control can be part of the XAML above. However, the contents of that scrollable control will be entirely code generated. Within that scrollable control will be a vertical list of forms by name with an expansion/contract button next to the name.  When the user clicks the expansion button, the form expands into view, and may be longer than the viewable area, and the user will need to be able to enter data into the entry fields.  I need the tab key to go from field to field as would be expected. If the user is on the last viewable field and there are more fields below, when the user hits the tab key, the for

Cannot create a row of size 8068 which is greater than the allowable maximum of 8060

SQL2K5, SP3, both DB's in 2005 compatability mode. I have the same table in two DB's, that are on the same server. The table in both DB's appears identicle. However, on one of them we get the above error when attempting to do an Insert into the table, and one of them works fine. In 2000, the answer was to "use TEXT", but per BOL 2005, that data type is going away. All ideas are appreciated. CREATE   TABLE [dbo].[Complaint]( [ComplaintId] [int] IDENTITY(1,1) NOT NULL, [SourceId] [smallint] NULL, [MethodId] [smallint] NULL, [Location] [nvarchar] (50) NULL, [CurrentStatusId] [smallint] NOT NULL, [CreateDate] [datetime] NOT NULL, [CreateOpid] [char] (8) NOT NULL, [LastUpdateDate] [datetime] NOT NULL, [LastUpdateOpid] [char] (8) NOT NULL, [DESSiteCodeId] [smallint] NULL, [DESAdminId] [smallint] NULL, [Narrative] [nvarchar] (max) NULL,   CONSTRAINT [PK_Complaint] PRIMARY KEY CLUSTERED ( [ComplaintId] ASC )   WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] )   ON [PRIMARY] GO insert   into [dbo].[Complaint] (   Narrative,CurrentStatusId,CreateDate, CreateOpid ,LastUpdateDate,LastUpdateOpid) values   ('abc' ,1,current_timestamp,'dennis',current_timestamp,'dennis' ) TIA, ChrisRDBA

setting inline image size with css?

I have an inline image in the header of a page that's height is being set with CSS.  The actual height of the image is slightly taller than what it's currently set to with css.  I like doing this this way because it was easier to get the image to the right size.  It avoided multiple attempts in photoshop.Is it a bad idea to set the height of an image this way?   I'm only concerned with the major modern browsers.  Are there any side effects of this that I should be aware of?

Bar-graph style - how to keep columns in relative height of size of "graph"

Hi, I need some input for this and imagined that someone else had seen something like it: I have a box, let's say a grid, where there are some bars in it. These bars could be rectangles in a ItemsControl. The grid has a fixed height and width - but the rectangles' height (and width) are set a from a collection of numbers. These numbers go from 0 to 200 - but in periods the numbers only go from 1 to 10. If I use absolute numbers, the rectangles will be tiny in height or width if the numbers are between 1 and 10 and the Grid is 200 in height and width. How do I make the size of these rectangles relative to the tallest one? I guess I could do some calculations 'behind the scenes' in code, but is that really necessary? Is there no other way? Thanks! --Anders

BitmapImage detect image size before calling EndInit()

Hi, I'm using the following converter to create the thumbnails images: public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { BitmapImage bi = new BitmapImage(); string FilePath = value as string; if (null != FilePath) { bi.BeginInit(); bi.DecodePixelHeight = 80; bi.CacheOption = BitmapCacheOption.OnLoad; bi.CreateOptions = BitmapCreateOptions.DelayCreation; bi.UriSource = new Uri(FilePath); bi.EndInit(); } if (bi.CanFreeze) { bi.Freeze(); } return bi; } catch { return DependencyProperty.UnsetValue; } }   The problem is that I want to detect the image file height before generating the actual BitmapImage. In other words I need something like this:   bi.BeginInit(); if(bi.Height > 80) { bi.DecodePixelHeight = 80; } bi.CacheOption = BitmapCacheOption.OnLoad; bi.CreateOptions = BitmapCreateOptions.DelayCreation; bi.UriSource = new Uri(FilePath); bi.EndInit();   Which of cause can't be done before the EndInit() has been called. Is there is any other solution that doesn’t require creating some sort of Image class and loading the image file into it. The problem is that I'm expecting to hav

How to create a button with image and text


Currently I have button on a form and I need to make buttons image but maintain the click event functions that they have. For instance I have a button that says Update. Is there a way to add an image and put text in that image that says Update and maintain it's functionality. here is the code for the button:

<asp:Button ID="btnUpdate" runat="server" Text="Update" Visible="False" />


Controlling Page Image Size / Scale

I have created a custom master page for a WSS 3.0 site and all is working well except for the fact that I want to use the default page images that are provided, but they are too wide for the area available.  I have tried setting the table width but the width of the image seems to override that, so I would like to know if there is a way I can control the size (or better yet the scale) of the page image when it is displayed in order to have it fit within the area I have on the custom master page.

Thanks in advance,

Wiki page and image's relative Url



My client is using wiki page. In the wiki page content, user may need to add image from current folder (where the wiki page located). When user adds an image from current folder in sharepoint designer, the image location is added as relative to the current location like 'image/header.jpg'. But when the page is saved the image location is remove from the page. However if user put the relative location from site root like '/folder/subfolder/header.jpg' the image works.


Even if the user try to upload the image from wiki editor in browser, the image can be uploaded in the root folder of a library. If user continues to upload images in a single folder, in the long run the images will not be manageable anymore.


Have anyone experience the problem? Is it bug or desired behavior?


Sohel Rana

Make font size relative to container or browser size?


Is there any way to make font size a percentage of the size of either the parent container or the browser window viewport? Having fixed-width fonts inside variable-width containers is causing the layout to break.

ISSUE: Cannot create a row of size which is greater than max 8060...Need Help




I have an issue related to maximum row size. I have a DW environment which has a table with multiple hierarchies and levels.


OLE DB error: OLE DB or ODBC error: Cannot create a row of size XXXX
which is greater than the allowable maximum of 8060. Errors in the OLAP
storage engine: An error occurred while the dimension, with the ID
of 'DATABASE', Name of 'DIMENSION' was being processed.
Server: The operation has been cancelled.

My current version is SQL Server 9.00.3257 (SP2 + CU 8). I would like to check if there is any upgrade available to fix this limitation (SQL Server 2005 SP3 / SQL Server 2008 SP1)....

Any advice is much appreciated.

Thanks in Advance

where to start? create an image on the fly from other images


Hi all

I hope this is in the right forum thread...

How do I create (or layer) a new image from  2 existing images with ASP.net on the fly?

Does anyone have any examples or links to websites?

or has anyone done this personally? any hints and tips?

also can i put this code (to create it) in a user control? instead of an external page?


Set the image size


 Is it possible to set the max size on a image in a div by code? If it does, how do I do it?

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