Selecting ONLY those fiels that need metadata written?

How do I select ONLY those images that need the metadata written? I've got 40,000 images, change a number of keywords for different groups - add, delete, rename, whatever. I DON'T want to have to save metadata for all 40,00 files 'cause LR is already so slow... And doing a save metadata for every group I change is painful 'cause it takes foreve just to update even a few files. I've got the preference turned on to automatically write changes to xmp, but I'm not working with anything that has sidecar files...
I want to be able to JUST select those images that need the metadata written out, then let it spend all night writing the changes.

Thanks Lee... But, that doesn't appear to be what I'm seeing. I've got autowrite on (at least as far as I know I do), but I can watch a set of files where I've made changes to keywords and even after all activity has stopped there'll be files with the metadata indicator showing they haven't been synchronized with the disk.... AND, I can go to Bridge and open one of these files and see that the keywords haven't been updated on the disk......
So, even though I have autowrite on, I can't be SURE the changes actually got written. And last night I selected everything and did a "Save metadata"... Just over 12 HOURS later it was at the 3% completed... This was on a catalog of approximately 35,000 images.
This is why I'd like to be able to just select those images needing updating. Hopefully, it'd be faster.

Similar Messages

  • JDBC: How  to select only those records which contains col1 is NULL

    Hi All,
    In JDBC SELECT scenario.
    I wants to select only those records which contains col1 is NULL.
    I am trying as follows:
    <key>
    <col1 isNull="TRUE" />
    </key>
    but in moni/monitoring i am getting Following Error
    006-12-01 19:35:20 Error Unable to execute statement for table or stored procedure. 'BG_SALARY_SEND_SAP_D' (Structure 'SELECT') due to java.sql.SQLException: FATAL ERROR document format: structure 'SELECT', key element 'key' contains no values
    2006-12-01 19:35:20 Error Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'BG_SALARY_SEND_SAP_D' (structure 'SELECT'): java.sql.SQLException: FATAL ERROR document format: structure 'SELECT', key element 'key' contains no values
    Please suggest how to do select rows with col1 is null.
    Regards

    Rohan,
    isNull= true is used to make the KEY element not mandatory.
    In your case, if the select query is
    select emp from emptest where empno is null
    , then the datatype will be,
    <root>
    <StatementName>
    <dbTableName action=”SELECT”>
      <table>emptest</table>
    <access>
    <emp></emp>
    </access>
    <key1>
    <b><empno hasQuot="NO">is null</empno></b>
    </key1>
    </dbTableName> 
    </StatementName>
    </root>
    I dont have a DB access to try this, but I think this should work.
    If this doesnt work, then you would need to use SQL_QUERY,
    <root>
    <StatementName>
    <anyName action=” SQL_QUERY”>
    <access>select emp from emptest where empno is null</access>
    </anyName > 
    </StatementName>
    </root>
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Regards,
    Bhavesh

  • How to call hr_location_api.create_location for different address style with only those fields that belongs specific to  that address style.

    How to call hr_location_api.create_location for different address style with only those fields that belongs specific to  that address style. It should decide at run time means at run time it will come to know the type of address style and based on that only the fields which belong to address details mapped to calling hr_location_api.create_location.
    Thanks in advance.

    You can create a wrapper package on top of the API (hr_location_api.create_location)
    In the wrapper package you set all the values dynamically based on your requirements(say the style and add_line columns are populated on your conditions) and then you call the API.
    Does that not work ?

  • Is it only pc's that need to be authorized or does it include itouch,ipads,macbook?

    Hi Is it only pc's that need to be authorized? does this include itouches, ipads,macbook,tablet by otherthan apple?

    Thank you for the quick responce. You helped alot. thank you

  • Select only those images which are in a Stack

    Hi.
    Is there any way to filter the Browser view to show only those images which are in a stack?
    I often make a few details (cropped versions) of Masters, which I keep stacked with the Master. I would like to filter my Browser view to show either only those Stacks, or, alternatively, only those Versions which are not in a Stack.
    Slightly more complicated: I have many whole-Library Smart Albums which pick up the cropped Versions (by Keyword). Some of these cropped Versions have become detached (un-Stacked). I would like to be able to filter these Smart Albums for Versions which are not part of a Stack.
    Even more complicated: I would like to filter the same Smart Albums for Versions which have Stack-mates in the same Smart Album -- that is, I would like to identify within the Smart Albums those Versions which share a Master. I've made this slightly easier by Stacking the Versions with the Master, but I don't know how to filter an Album for those Stacks which contain two or more Versions.
    In short, I'm looking to access the properties "Is in Stack" (or whatever Aperture calls it), and "Number of Stack-mates in Stack in this view" (or whatever Aperture calls it). Aperture knows this -- it is displayed visually -- but I don't how to access it.
    Thanks.

    Thanks for the reply, Allen. That's all I've been able to figure out. It would nice (and, imho, proper) for Aperture (a DBMS) to provide user access to all properties.

  • HOW TO SELECT ONLY THOSE RECORDS WHERE NOT AVAILABLE ON SECOND TABLE

    hi
    i have two tables one name is menus and second name is UGroupDetail. Actually i have created it for user role privileges for my application
    USE [LedgerDB]
    GO
    /****** Object: Table [dbo].[Menus] Script Date: 03/28/2015 13:45:27 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Menus](
    [RightID] [int] NOT NULL,
    [RightName] [nvarchar](200) NULL,
    [GroupID] [int] NULL,
    CONSTRAINT [PK_Menus] PRIMARY KEY CLUSTERED
    [RightID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    second table is
    USE [LedgerDB]
    GO
    /****** Object: Table [dbo].[UGroupDetail] Script Date: 03/28/2015 13:46:12 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[UGroupDetail](
    [RightID] [int] NOT NULL,
    [RightName] [nvarchar](200) NULL,
    [GroupID] [int] NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[UGroupDetail] WITH CHECK ADD CONSTRAINT [FK_UGroupDetail_Menus] FOREIGN KEY([RightID])
    REFERENCES [dbo].[Menus] ([RightID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[UGroupDetail] CHECK CONSTRAINT [FK_UGroupDetail_Menus]
    GO
    ALTER TABLE [dbo].[UGroupDetail] WITH CHECK ADD CONSTRAINT [FK_UGroupDetail_UserGroup] FOREIGN KEY([GroupID])
    REFERENCES [dbo].[UserGroup] ([GroupID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[UGroupDetail] CHECK CONSTRAINT [FK_UGroupDetail_UserGroup]
    UGroupDetail have many groups as assigned to a new user but Menus table has only default groups which is 90 records
    Menus table is a primary table and UGroupDetail is a Foreign key table
    now i want to combined these tables and want to get only remaining records for each group
    for example i have assigned 5 roles to GroupID 2 and now when i apply select commands the result should be 85 out 90 for GroupID 2
    but i have not idea how to modify select query for get desired result

    I don't really understand the tables. What is GroupID doing in the Menues table? And what does an entry without a RightName mean? Shouldn't that column be NOT NULL?
    The UGroupDetail does not have any primary key. From your description, I would expect the PK to be (RightID, GroupID). But strangely enough, GroupID is nullable. So is RightName, but I think this column is redundant and should be removed.
    Anyway, if I understand your question correctly, you need something like:
    SELECT UG.Name, M.RightName
    FROM   UserGroups UG
    CROSS  JOIN Menus M
    WHERE  NOT EXISTS (SELECT *
                       FROM   UGroupDetail UGD
                       WHERE  UG.GroupID = UGD.GroupID
                         AND  UG.RightID = M.RightID)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Converter help for all those people that need it

    i just bought xilisoft ipod video converter after i tried the free version from the other post and i want to put on the keygen because i want to share it and plus its mine so i can do what ever i want with it so here it is
    (name) TEAM ViRiLiTY
    (serial) MXILKYAMEYIRRMISMTE-0FE2-7E8A-98A7-405B
    there it is folks xilisoft is only for Window users one for mac would be http://www.nullriver.com/index/products/moviepod so there it is folks this is only a one time thing

    Hi,
    Go through the below link, here i gave a answer on inner joins issue, you will understand.
    Re: Improve performance of a SQL request
    <b>Reward points if it helps,</b>
    Satish

  • I have only a few clips that need to be up resed

    I read the Ken Stone article on working in low res, but in order to up-res, you have to create an entire offline sequence. I only have a few clips that were captured at OfflineRT (photo jpeg), I cut them in to a full-res sequence, now how do I select only those clips to be up-resed?
    Thank you!

    If you where hoping to recapture the OfflineRT stuff from your original source tapes...
    Select those clips in the Browser (no need to take them Offline or anything)
    Open Log & Capture and confirm that everything in the Capture Settings tab is correct for your source material
    Click Batch Capture
    In the dialog that pops up - +and this is crucial+ - uncheck the *Use Logged Clip Settings* box
    Insert the reels as requested by FCP
    Once your material is recaptured, you'll have to adjust any Motion Tab settings for clips in sequences (things like scale and distort need to be reset, usually) but it usually beats having to recreate your entire project via Media Manager if you've only got a handful of clips to uprez.

  • Is there a way to filter content search in iTunes to show only those apps/music etc that are compatible with a particular hardware/software/firmware configuration.

    It is annoying to download an app that subsequently states it is only for iPhone 4 or OS x.x.x
    Is there some way of filtering content or content search to show only those items that are compatible with whatever hardware/firmware I happen to be using?
    Interestingly in the Apple drop down list of Products the earliest iPhone shown is 3G !!  Have they disowned all models they sold before that variant?  I have an iPhone 2G.  Works well, does what it says on the tin, have no reason/need to throw away and buy another.  Yet they manage to provide firmware updates (now 3.1.3) for a product that is not listed!!!

    And some more info I just found...
    I found a web article that confirms that it is possible to clean ("sanitize" or "scrub") the files manually on Mac. It even provides a link that (I am assuming) details how to do it.
    Unfortunately, the link doesn't work for me. Does the link work for anybody else?
    Here's the article: http://lawyerist.com/remove-metadata-with-batch-software/
    Scroll down to the 3rd section "How to remove metadata?" to see the link that I'm referring to.

  • Select only words with capitals

    If I have data stored in my Database much like this Sentence, with Some words containing uppercase letters and some not, what is the simplest Way to select only those words which contain upperCase letters?
    From the above sentence, for example, I would want to see the result :
    If I Database Sentence Some Way upperCase
    Note that the uppercase letter(s) will not always be at the start of a word.
    Is there a simple way to achieve this? I started dabbling with REGEXP_LIKE, but my regular expressions are pretty hopeless at the best of times :-(

    I've seen more regular expression syntax explanation documents in my time than you've had hot dinners, probably. I'm afraid I still plead complete ignorance and find constructing anything other than the very simplest incredibly difficult, even with the help of various freebie utilities and tools you can download to help you do the job. It's a blind spot I have, and it's not going away any time soon. So yes, I have seen before at least the first of those pages you linked to, but I can't say it's helped me much.
    For the rest, I gave an example of the input and output I'd like to achieve. Your suggestion regarding the lastname column from the EMP table doesn't help in that regard, and even when I translate it into something approaching my actual situation, it doesn't do what I need it to do:
    create table test_t1 (col1 varchar2(4000));
    insert into test_t1 values ('If I have data stored in my Database much like this Sentence, with Some words containing uppercase letters and some not, what is the simplest Way to select only those words which contain upperCase letters?');
    commit;
    SQL> select * from test_t1 where col1 like '^[A-Z]%';
    no rows selectedAlso, you've apparently used the "^" character to indicate that it's the beginning of the string that should be checked for containing an uppercase character, but as I mentioned, my uppercase characters can appear anywhere within the string.
    Anyone else, please?

  • I want to be able to select only the pages I want to print ei. 2-5 vs 1-8 but I can';t figure out how to edit the final #

    I want to economize on ink so I want to be able to select, for printing,only those pages that are important to me.. For example instead of printing pages 1 thru 8 , I may want to eliminate pictures and/or comments at the end of an article. I can adjust the beginning # but not the final one. Any help would be appreciated.

    Bonjour has nothing to do with this.
    Restore your iPhone with iTunes as a new iPhone or not from your iPhone's backup to get rid of that garbage which removed all built-in secuirty included with iOS on your iPhone.
    If your iPhone is not recognized by iTunes, check this link.
    http://support.apple.com/kb/TS1538
    http://support.apple.com/kb/TS1591?viewlocale=en_US

  • How can I count only text fields that have been used?

    Hi,
    I'm using Livecycle Designer for a dynamic form.  I have a section of the form that contains field for the user to enter goals and then rate the goal.  I'd like to count only the text fields with entries and then have the total number of rates divided by the number of text field entries.
    Row 1 , column 1 -- Goal is to pick up 5 apples.   Row 1, column 2 - the rate given is 5
    Row 2, column 1 - Goal is to pick up 5 pears.  Row 1, column 2 - the rate given is 5
    Two goals for a total rating of 10     ---  10 divided by 2 = 5
    Is it possible to count only those fields that are populated?
    Also, is it possible to create an error message if the user entered 5 goals but only rated 4 of them?

    You could do a simple check for null and increase a counting variable if there's a value in the field. Here's a sample:
    var goalCount = 0;
    if (field1.rawValue != null){
         goalCount = goalCount + 1;
    if (field2.rawValue != null){
         goalCount = goalCount + 1;
    if (field3.rawValue... etc.
    this.rawValue = totalPoints/goalCount;
    where totalPoints is a sum of the values in the goal fields. This script is javascript and should be placed in the calculate event of the field showing your average score.

  • New owner here.  How can I select specific pages of a document found on line and print just those pages.  What I see is the ability to select only 1 page at a time and print that one selected page only.   Thanks much.

    New owner here.  I see that in printing I can select one page and print same.  How do I select numerous pages from a document and print only those selected pages? I would not think that I can only select one page at a time.  Thanks much

    Just change the range as illustrated below.  If you don't see that, click the Show Details button.

  • How to update a large (over 4 million item) List(Of Byte) quickly by altering indexes contained in a Dictionary(Of Integer, Byte) where the Dictionaries keys are the indexes in the List(Of Byte) that need to be changed to the values for those indexes?

       I'm having some difficulty with transferring images from a UDP Client to a UDP Server. The issue is receiving the bytes necessary to update an original image sent from the Client to the Server and updating the Servers List(Of Byte) with the
    new bytes replacing bytes in that list. This is a simplex connection where the Sever receives and the Client sends to utilize the least amount of bandwidth for a "Remote Desktop" style application where the Server side needs image updates of whatever
    occurs on the Client desktop.
       So far I can tranfer images with no issue. The images can be be any image type (.Bmp, .Gif, .JPeg, .Png, etc). I was working with sending .JPeg's as they appear to be the smallest size image when a Bitmap is saved to a memory stream as type
    .JPeg. And then I am using GZip to compress that byte array again so it is much smaller. However on a loopback on my NIC the speed for sending a full size screen capture is not very fast as the Server updates fairly slowly unless the Clients screen capture
    Bitmap is reduced in size to about 1/3'd of the original size. Then about 12000 bytes or less are sent for each update.
       Due to .JPeg compression I suppose there is no way to get the difference in bytes between two .JPegs and only send those when something occurs on the desktop that alters the desktop screen capture image. Therefore I went to using .Bmp's as each
    .Bmp contains the same number of bytes in its array regardless of the image alterations on the desktop. So I suppose the difference in bytes from a second screen capture and an inital screen capture are what is different in the second image from the initial
    image.
       What I have done so far is save an initial Bitmap of a screen capture using a memory stream and saving as type .Bmp which takes less than 93 milliseconds for 4196406 bytes. Compressing that takes less than 118 milliseconds to 197325 bytes for
    the current windows on the desktop. When that is done PictureBox1 is updated from nothing to the captured image as the PictureBox's background image with image layout zoom and the PictureBox sized at 1/2 my screens width and 1/2 my screens height.
       Then I save a new Bitmap the same way which now contains different image information as the PictureBox is now displaying an image so its back color is no longer displayed (solid color Aqua) and the cursor has moved to a different location. The
    second Bitmap is also 4196406 in bytes and compressed it was 315473 bytes in size.
       I also just found code from this link Converting a Bitmap to a Byte Array (and Byte Array to Bitmap) which gets a byte array
    directly from a Bitmap and the size of that is 3148800 for whatever is full screen captured on my laptop. So I should be able to work with smaller byte arrays at some point.
       The issue I'm having is that once the Client sends an image of the desktop to the Server I only want to update the server with any differences occuring on the Clients desktop. So what I have done is compare the first screen captures bytes (stored
    in a List(Of Byte)) to the second screen captures bytes (stored in a List(Of Byte)) by using a For/Next for 0 to 4196405 where if a byte in the first screen captures List is not equal to a byte in the second screen captures List I add the index and byte of
    the second screen captures list to a Dictionary(Of Integer, Byte). The Dictionary then only contains the indexes and bytes that are different between the first screen capture and second screen capture. This takes about 125 milliseconds which I think is pretty
    fast for 4196406 byte comparison using a For/Next and adding all the different bytes and indexes for each byte to a Dictionary.
        The difference in Bytes between the inital screen capture and the second screen capture is 242587 as an example which changes of course. For that amount of bytes the Dictionary contains 242587 integers as indexes and 242587 bytes as different
    bytes totaling 485174 bytes for both arrays (keys, values).  Compressed the indexes go from 242587 to 43489 bytes and the values go from 242587 to 34982 bytes. Which means I will have to send 78, 481 bytes from the Client to the Server to update the display
    on the server. Quite smaller than the original 4196406 bytes of the second Bitmap saved to type .Bmp or the compressed size of that array which was 315473 bytes. Plus a few bytes I add as overhead so the server knows when an image array ends and how many packets
    were sent for the array so it can discard complete arrays if necessary since UDP is lossfull although probably not so much in current networks like it may originally have been when the internet started.
        In reality the data from the Client to the Server will mostly be the cursor as it moves and updating the Server image with only a few hundred bytes I would imagine at a time. Or when the cursor selects a Button for example and the Buttons
    color changes causing those differences in the original screen capture.
       But the problem is if I send the Dictionaries Indexes and Bytes to the Server then I need to update the original Bitmap List(Of Byte) on the server by removing the Bytes in the received informations Index locations array from the Servers Bitmap
    List(Of Byte) and replacing those Bytes with the Bytes in the received informations Byte array. This takes so long using a For/Next for however many indexes are in the received informations Index array to update the Bitmap List(Of Byte) on the server using
    "Bmp1Bytes.RemoveAt(Index As Integer)" followed by "Bmp1Bytes.Insert(Index As Integer, Item As Byte)" in the For/Next.
        I've tried various For/Next statements including using a new List(Of Byte) with If statements so If the the integer for the For/Next ='s the Key in a Dictionary(Of Integer, Byte) using a Counter to provide the Dictionaries Key value then
    the Dictionaries byte value will be added to the List(Of Byte) and the counter will increas by one Else the List(Of Byte) adds the original "Bmp1Bytes" byte at that index to the new List(Of Byte). This takes forever also.
       I also tried the same For/Next adding to a new Dictionary(Of Integer, Byte) but that takes forever too.
       I think I could use RemoveRange and AddRange to speed things up. But I don't know how to retrieve a contiguous range of indexes in the received indexes that need to be updated in the servers "Bmp1Bytes" List(Of Byte) from the received
    array of indexes and bytes which are in a Dictionary(Of Integer, Byte).  But I believe this would even be slower than some realistic method for replacing all Bytes in a List(Of Byte) when I have the indexes that need to be replaced and the bytes to replace
    them with.
       Even if I just used AddRange on a new List(Of Byte) to add ranges of bytes from the original "Bmp1Bytes" and the changes from the Dictionary(Of Integer, Byte) I think this would be rather slow. Although I don't know how to do that
    by getting contiguous ranges of indexes from the Dictionaries keys.
       So I was wondering if there is some method perhaps using Linq or IEnumerable which I've been unable to figure anything out which could do this.
       I do have some copy and pasted code which I don't understand how it works that I am using which I would guess could be altered for doing something like this but I can't find information that provides how the code works.  Or even if I did
    maybe I can't understand it. Like the code below which is extremely fast.
       Dim strArray() As String = Array.ConvertAll(Of Integer, String)(BmpComparisonDict.Keys.ToArray, Function(x) x.ToString())
    La vida loca

    Monkeyboy,
    That was quite a bit to read, but still a bit unclear. Could you put a specific list of goals/questions, asked in the smallest possible form?
    It seems like either you're making a program that monitors activity on your computer, or you're writing some kind of remote pc app.
    When you do get your bytes from using lockbits, keep in mind all the files header info would be lost. I think retaining the header info is worth the extra bytes.
    The other, thing: I'm not sure if you're taking 32bpp screen shots, but also keep in mind that the "whole desktop" is the final destination for blended graphics, if that makes sense. What I mean is that there is no need to capture an "alpha"
    channel for a desktop screenshot, as alpha would always be 255, this could save you 1 byte per pixel captured... Theres nothing "behind" the desktop, therefore no alpha, and every window shown above the desktop is already blended. I suggest using
    24Bpp for a full screen capture.
    Your X,Y information for the mouse could be stored as UINT16, this would save you a measly 2 bytes per location update/save.
    When you update your byte arrays, maybe you can turn the array into a stream and write to whatever index, however many bytes, that should prevent a "Shift" of bytes, and instead overwrite any bytes that "get in the way".
    ex
    Dim example As String = "This is an example."
    Dim insertString As String = "was"
    Dim insertBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(insertString)
    Dim bytes As Byte() = System.Text.Encoding.ASCII.GetBytes(example)
    Dim modifiedBytes As Byte() = {}
    Using ms As New System.IO.MemoryStream(bytes)
    ms.Position = 5
    ms.Write(insertBytes, 0, 3)
    modifiedBytes = ms.ToArray
    End Using
    Dim newString As String = System.Text.Encoding.ASCII.GetString(modifiedBytes)
    'Notice how below there isn't the word "is" anymore, and that there isn't a
    'space.
    'This demonstrates that you overwrite existing data, versus shifting everything to
    'the right.
    'Returns: This wasan example.
    MsgBox(newString)
    “If you want something you've never had, you need to do something you've never done.”
    Don't forget to mark
    helpful posts and answers
    ! Answer an interesting question? Write a
    new article
    about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.
    Well it's too much to read. I was really tired when I wrote it. Even the below is too much to read but perhaps gets the point across of what I would like to do which I think
    Joel Engineer may have answered but I'm not sure. As I'm still too tired to understand that yet and research what he said in order to figure it out yet.
    But maybe the code below can provide the concept of the operation with the comments in it. But seeing as how I'm still tired it may be confused.
    Option Strict On
    Imports System.Windows.Forms
    Imports System.IO
    Imports System.IO.Compression
    Imports System.Drawing.Imaging
    Imports System.Runtime.InteropServices
    Public Class Form1
    Dim Bmp1Bytes As New List(Of Byte)
    Dim Bmp1BytesCompressed As New List(Of Byte)
    Dim Bmp2Bytes As New List(Of Byte)
    Dim BmpComparisonDict As New Dictionary(Of Integer, Byte)
    Dim BmpDifferenceIndexesCompressed As New List(Of Byte)
    Dim BmpDifferenceBytesCompressed As New List(Of Byte)
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    SomeSub()
    End Sub
    Private Sub SomeSub()
    ' Pretend this code is in UDP Client app. A screen capture is performed of the desktop. Takes about 90 milliseconds.
    Bmp1Bytes.Clear()
    Using BMP1 As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
    Using g1 As Graphics = Graphics.FromImage(BMP1)
    g1.CopyFromScreen(0, 0, 0, 0, BMP1.Size)
    Cursor.Draw(g1, New Rectangle(Cursor.Position.X, Cursor.Position.Y, Cursor.Size.Width, Cursor.Size.Height))
    Using MS As New MemoryStream
    BMP1.Save(MS, System.Drawing.Imaging.ImageFormat.Bmp)
    Bmp1Bytes.AddRange(MS.ToArray)
    End Using
    End Using
    End Using
    Bmp1BytesCompressed.AddRange(Compress(Bmp1Bytes.ToArray))
    ' UDP Client app sends Bmp1BytesCompressed.ToArray to UDP Server which is the entire image of the desktop that the UDP
    ' Client is on. This image takes awhile to send since compressed it is about 177000 bytes from over 4000000 bytes.
    ' I will be using different code just to get the bytes from the actual Bitmap in the future. That is not important for now.
    ' Pretend the UDP Server has received the bytes, decompressed the array received into a List(Of Byte) and is displaying
    ' the image of the UDP Clients desktop in a PictureBox.
    ' Now the image on the UDP Clients desktop changes due to the mouse cursor moving as an example. Therefore a new Bitmap
    ' is created from a screen capture. This takes about 90 milliseconds.
    Bmp2Bytes.Clear()
    Using BMP2 As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
    Using g1 As Graphics = Graphics.FromImage(BMP2)
    g1.CopyFromScreen(0, 0, 0, 0, BMP2.Size)
    Cursor.Draw(g1, New Rectangle(Cursor.Position.X, Cursor.Position.Y, Cursor.Size.Width, Cursor.Size.Height))
    Using MS As New MemoryStream
    BMP2.Save(MS, System.Drawing.Imaging.ImageFormat.Bmp)
    Bmp2Bytes.AddRange(MS.ToArray)
    End Using
    End Using
    End Using
    ' Now I have the original images bytes in Bmp1Bytes and the new images bytes in Bmp2Bytes on the UDP Client. But I don't
    ' want to send all of the bytes in Bmp2Bytes to the UDP Server. Just the indexes of and the bytes that are different in
    ' Bmp2Bytes from Bmp1Bytes.
    ' This takes less than 100 milliseconds for what I've tested so far where over 500000 bytes in Bmp2Bytes are different
    ' than the bytes in Bmp1Bytes. Usually that amount would be much less. But during testing I was displaying the image
    ' from Bmp1 bytes in a PictureBox so a large amount of data would change between the first screen shot, the PictureBox
    ' then displaying an image on the same PC and then the second screen shot.
    BmpComparisonDict.Clear()
    For i = 0 To Bmp1Bytes.Count - 1
    If Bmp1Bytes(i) <> Bmp2Bytes(i) Then
    BmpComparisonDict.Add(i, Bmp2Bytes(i))
    End If
    Next
    ' So now I have all the difference bytes and their indexes from Bmp2Bytes in the BmpComparisonDict. So I compress
    ' the indexes into on List and the Bytes into another List.
    BmpDifferenceIndexesCompressed.Clear()
    BmpDifferenceBytesCompressed.Clear()
    BmpDifferenceIndexesCompressed.AddRange(Compress(BmpComparisonDict.Keys.SelectMany(Function(d) BitConverter.GetBytes(d)).ToArray()))
    BmpDifferenceBytesCompressed.AddRange(Compress(BmpComparisonDict.Values.ToArray))
    ' Now pretend the UDP Client has sent both those arrays to the UDP Server which has added both decompressed arrays
    ' to a Dictionary(Of Integer, Byte). And the server has the original image decompressed bytes received in a List
    ' called Bmp1Bytes also.
    ' This is where I am stuck. The UDP Server has the Dictionary. That part was fast. However there is no
    ' fast method I have found for creating a new List(Of Byte) where bytes in the originally received List(Of Byte) that
    ' do not have to be altered are placed into a new List(Of Byte) except for the indexes listed in the
    ' Dictionary(Of Integer, Byte) that need to be placed into the appropriate index locations of the new List(Of Byte).
    ' The below example for doing so is exceptionally slow. Pretend UpdateDictionary has all of the decompressed indexes
    ' and bytes received by the UDP Server for the update contained within it.
    Dim UpdateDictionary As New Dictionary(Of Integer, Byte)
    Dim UpdatedBytes As New List(Of Byte)
    Dim Counter As Integer = 0
    For i = 0 To Bmp1Bytes.Count - 1
    If i = UpdateDictionary.Keys(Counter) Then ' Provides the index contained in the Keys for the Dictionary
    UpdatedBytes.Add(UpdateDictionary.Values(Counter))
    Counter += 1
    If Counter > UpdateDictionary.Count - 1 Then Counter = 0
    Else
    UpdatedBytes.Add(Bmp1Bytes(i))
    End If
    Next
    ' So what I'm trying to do is find an extremely fast method for performing something similar to what the
    ' above operation performs.
    End Sub
    Private Function Compress(BytesToCompress() As Byte) As List(Of Byte)
    Dim BytesCompressed As New List(Of Byte)
    Using compressedStream = New MemoryStream()
    Using zipStream = New GZipStream(compressedStream, CompressionMode.Compress)
    zipStream.Write(BytesToCompress, 0, BytesToCompress.Count)
    zipStream.Close()
    BytesCompressed.AddRange(compressedStream.ToArray)
    End Using
    End Using
    Return BytesCompressed
    End Function
    Private Function Decompress(BytesToDecompress() As Byte) As List(Of Byte)
    Dim BytesDecompressed As New List(Of Byte)
    Using DecompressedStream = New MemoryStream()
    Using zipStream = New GZipStream(DecompressedStream, CompressionMode.Decompress)
    zipStream.Write(BytesToDecompress, 0, BytesToDecompress.Count)
    zipStream.Close()
    BytesDecompressed.AddRange(DecompressedStream.ToArray)
    End Using
    End Using
    Return BytesDecompressed
    End Function
    End Class
    La vida loca

  • HT3349 How do you select a sub-set of cells from the entire document so you can print only those specific cells?

    How do you select a sub-set of cells from the entire document so you can print only those specific cells?

    There is no analog to MS Excels print range.  So the next best thing is to plan your data so that you don't need to use print range.  The next best thing after that is to select the range of cells you want to print, then copy, the switch to the application Preview, and create a new document from the clipboard (select the menu item "File > New from Clibboard") then select all, copy then paste to the destination (maybe an email) .
    You can also paste that portion of the table into another table (or a new table) by pasting values only

Maybe you are looking for

  • Issues with Photoshop 3.0 on Windows 7

    I've been having some issues and it seriously slows down the editing/drawing process. When I scoll down or right, it looks like blinds repeating itself. When I undo something, randomly colored grindlines appear, always in the same spot of the picture

  • Remove words from file

    Hello, I have created a class which is supposed to be an array of stopwords (words that I want to remove from a file). Then I want to create another class which reads in a file. It reads the file. Then it looks through the array of stopwords. If it e

  • Change name of network

    I would like to change the name of my internet network. How do I do this with an existing account? cheers!

  • System errors -  creating a log file

    Is there any class, method for trapping system, application errors, exceptions and warnings in a system and then creating a log file.

  • Saving Illustrator .ai file as a .jpg

    I have Creative Suite 3 on Windows. In Illustrator how do I save a file as a .jpg? Also how do I make the coloured text white? I have managed to change the body of the text but I can't seem to change the ® into white characters. I can't seem to strok