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

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

Compare 2 WPF bitmaps

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :WPF
Hi I have a question. I have an app which take some snapshots of the screen from time to time(as bitmaps)and compares the current screen with the previous one. This must work very fast and I was curios if I can use BitmapSource to achieve better performance(using GPU). The current solution compares pixel by pixel the 2 GDI+ bitmaps but it doesnt work as desired. Thank you

View Complete Post

More Related Resource Links

Compare List


i have got two list<string> containing datas

i would like to compare the both list and the result to new list whch does not contains the same data.(basically unique data)

eg shown below..

list A       list b          list c

a             a                 d

b           d                    c

c            f                   e

f            e

plz let me knw..

Foundations: Bitmaps and Pixel Bits


Charles Petzold takes an inside look at the flexible bitmap pixel formats offered by the retained-mode graphics features of Windows Presentation Foundation.

Charles Petzold

MSDN Magazine June 2008

filter n compare between two table in resultset


Hi .. I have two table 

Say Table1 n Table2


Item              ItemName

001                 Laptop

001                  PC

002                  PC

002                  Printer

003                  Pendrive

004                  Keyboard

004                  CPU


Item                  ItemName

001                   laptop

001                   PC

002                   Printer

004                   CPU

Here am comparing table1 with table2

The Itemname which is available in both table1 n table2 should be dropout ... Other Item should be displayed ...

I need the sql result set like this :

Item                 &n

VS2010 Schema Compare Issue

I’m using VS2010 Schema Compare to compare two databases – let’s call them ‘DB1’ and ‘DB2’. I want DB1 to have its schema altered to match DB2. I select DB2 as the source and DB1 as the target, and compare. When I hit the Write Updates button, I am getting the following error: SQL01268: .Net SqlClient Data Provider: Msg 1834, Level 16, State 1, Line 1 The file ‘c:Program FilesMicrosoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\DB1.mdf’ cannot be overwritten. It is being used by database ‘DB1’. Why is Schema Compare trying to create a new DB? And, more to the point, why is it trying to create a DB named the same as the Source? Can anyone give me a workarround here? Thanks in advance.

InteropBitmap, GDI bitmaps, and the alpha channel

Hey, After having successfully used InteropBitmap to render Windows Forms bitmaps in WPF scenes, I recently tried the same sort of thing using plain old GDI bitmaps, and I got surprising results.  So I am just doing something like: CBitmap gdiBitmap;gdiBitmap.CreateCompatibleBitmap( (CDC*) &dc, rClient.Width(), rClient.Height() );    and then I select it into a DC and make some GDI calls to fill it, draw a FrameRect, and draw some text.  After that, I do the normal dance to get the bitmap out of the DC, make a BitmapSource from it, and assign that to the Source property of the WPF Image in my scene: CBitmap * resbmp = dcOff.SelectObject( pOldBitmap );   HBITMAP hbmp = (HBITMAP) resbmp->GetSafeHandle();     BitmapSource ^bmpSource = CreateBitmapSourceFromHBitmap( (System::IntPtr) hbmp,       IntPtr::Zero, Int32Rect::Empty, BitmapSizeOptions::FromEmptyOptions() );   InteropBitmap ^ibmp = static_cast<InteropBitmap^>( bmpSource );     m_WPFImage->Source = ibmp;    When I do the above, the bitmap does not display *at all*.  After making some other calls to get the actual bits for the GDI bitmap, I can see that all of the alpha values are 0.  So what I'm getting is a bitmap that is completely transparent, and that is why InteropBitmap displays nothing.  The only way I have found to work around this is to pass the bitmap through GDI+ before creati

How to use SharePoint Server 2007 SP2 to compare documents without opening one by one in Word ? (ver

Hi All, How to use / access the versiondiff.apsx feature ? I'm using SharePoint 2007 SP2 Enterprise but somehow i cannot use that features like in this website said: http://www.ssw.com.au/ssw/Standards/BetterSoftwareSuggestions/SharePointTeamServices.aspx for example: here's my document library - http://mossdev01/Correspondence/Forms/AllItems.aspx Diff - http://mossdev01/Correspondence/versiondiff.aspx --> FAILED 404 ? Any kind of help and suggestion would be greatly appreciated. Thanks, Albert/* Infrastructure Support Engineer */

Document Compare feature in Sharepoint Document Management

We are in the design stage of implementing a Document Management system in Sharepoint.  My client wants to compare versions of documents.  Can anyone tell me if this feature in Sharepoint is using the Doc Compare function of Word or is there a more robust feature in sharepoint?  My client is looking for something more robust than what is offered by MS Word.

Set up a validator that compare the value of the current field with an other (using Dynamic Data)

Hi! Most of it is in the title : I'd like have a validator on the DateTime_Edit template for example that allows to compare this field with an other DateTime field. My problem is when I am in the DateTime_Edit template of my "master field" (the one I want to check), how can I access to the other field given the architecture of Dynamic Data FieldTemplates? But perhaps I'm not thinking in a good way on this control. Any advice will be welcome. Thanks Raphaelp

Compare Validation for the Title field of the list

Hi, I do have a field known as 'Title' in the list.My requirement is there should be not be any duplicate values i.e first time if i enter say 'test' in Title field it should save where as second time when i enter same text as 'test' it should show message as 'item already exists with the Title that you have entered'.Ofcourse i should do the compare validation over here but just let me know how to do this Thanks & Regards, Sudheer

Graphics Bitmaps & Rectangles

I am trying to draw 2 bitmap images on top of each other. 1 is a background image that only changes occasionally and the other is a foreground image the moves around a lot. The foreground image is usually an ellipse. But when I show it I always end up with the corners of the constraining rectangle being shown! I have included some basic code that demonstrates what I mean. How can I show two bit maps with the top one only showing the exact shape I require (without gray corners). Also if I want to remove the foreground image from being seen do I need to redraw the entire background? or can I just redraw the bit where the foreground image was. or can I just hide the foreground image somehow? This maybe a basic question - Graphics are a new area to me! Many thanks in advance!   using   System; using   System.Collections.Generic; using   System.ComponentModel; using   System.Data; using   System.Drawing; using   System.Drawing.Drawing2D; using   System.Text; using   System.Windows.Forms; namespace   TEST200 {   public partial class Form1 : Form {   private Bitmap bmpBACKGROUND;   private Bitmap bmpFOREGROUND;   public Form1() { InitializeComponent(); }   private void Form1_Load(object sender, EventArgs e) { bmpBACKGROUND = new Bitmap(this.ClientRectangle.Width,

Compare Date in LINQ

Dear all, How to do in LINQ?? And below is correct or not if put string.format in LINQ??   Datetime updatedDate=DateTime.Now; string upddate=string.format("yyyy-MM-dd", updatedDate); var result=( from p in W_Order                   where string.format("yyyy-MM-dd", p.orderdate) == upddate                    select new order {                       .........                        }).toList();            

How to compare file outputs from DEV and PROD

Hi I have a requirement to automate the testing of .net application that generates some output files in pdf or html based on account number. How can I automate it to compare the results from DEV environment and the production environment? What is the best way to do so? 

Custom validation attribute that compare 2 valaues

I want to create Custom validation attribute  that compare 2 valaues i wnat to get the two vlaue   in side the validator together sucha that i have check  2 conditions 1)if the values of the two fieds are 0 then no need to do any comparison else value 1 should be less than value 2 MVC2  

Compare 2 directories

Hai Friends,   How can I compare 2 directories in c#. If you have send me the code.   GSVS

Compare initial and final values using javascript

My Page consist of  8 text box and Button named update...Initially when the page is called values are filled in to the textbox from the DB;here is wat i require1. at intial page load i want the values in of 8 textbox to stored in array in javascript .2. when pressing the button update, i need a method (javascript) to comapre the initial on load values with new values(ie if values of textbox is changed ) so           that the text box background color should displayed in different color..In Simple words ..i would like change back ground color of text box of changed values in the text box when clicking button update.please note that i would like this to be performed  by OnClientClick method of button

How to use compare validator with dd/MM/yyyy format of date

Hi all,  I have a form of leave application that has 2 dates, start date and end date. now i'm using the dd/MM/yyyy format for the date entry and i need to Validate end date like end date must me greater than or equal to start date. i want to do that with compare validator but its not working properly because of the Date  formats controls are using.    Currently i'm using textbox with Calendar extender ajax toolkit control.    So please help me if anybody have some hints.    Thanks in advance.

Compare databases

Hello Friends,I am working on a project in which I am taking backup of the database and restoring the database. I am creating new versions of the application which will be available from time to time to the client. At the time of installation or upgrade of older version to new version I need to check that is there any change in the database, if there is no change in the database then leave the updation of database, if there are changes in the new version, then we need to upgrade the database.Please suggest a way to compare the schema of databases so that I can compare at installation time.Thanks and Regards,
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