Issue with creating bitmap image data for Format8bppIndexed and Format4bppIndexed

We are using below method to convert byte array into bitmap . we have successfully converted 16,24,32 etc. Pixel formats but we are facing issue while converting 4 and 8 pixel
formats  image is rendering in blur format and image starting and ending positions are changed.
<summary>
/// Converting the raw data into bitmap
</summary>
<param name="buffer">Byte array of the image rawdata</param>
<param name="nWidth">Image width</param>
<param name="nHeight">Image height</param>
<param name="nBitCount">Image Pixel format</param>
<returns></returns>
internal
Bitmap ConvertRawDataToBitMap(byte[]
buffer, int nWidth,
int nHeight,
int nBitCount,PDIB
pDIB=null)
Size imageSize =
new
Size(nWidth, nHeight);
PixelFormat imagePixelFormat = GetPixelFormat(nBitCount);
Bitmap bitmap =
new
Bitmap(imageSize.Width, imageSize.Height, imagePixelFormat);
Rectangle wholeBitmap =
new
Rectangle(0, 0, bitmap.Width, bitmap.Height);
BitmapData bitmapData = bitmap.LockBits(wholeBitmap,
ImageLockMode.WriteOnly, imagePixelFormat);
//Marshal.Copy(buffer, 0, bitmapData.Scan0, buffer.Length);
Marshal.Copy(buffer, 0, bitmapData.Scan0, bitmapData.Stride * bitmap.Height);
bitmap.UnlockBits(bitmapData);
bitmap.RotateFlip(RotateFlipType.Rotate180FlipX);
return bitmap;
<summary>
/// Returns the pixel format from given bit count.
</summary>
<param name="nPixelBitCount">Pixel bit count example 4 or 8 or 16 or 24 ..etc</param>
<returns></returns>
private
PixelFormat GetPixelFormat(int
nPixelBitCount)
PixelFormat pixelFormat =
PixelFormat.Undefined;
switch (nPixelBitCount)
case 4:
pixelFormat =
PixelFormat.Format4bppIndexed;
break;
case 8:
pixelFormat =
PixelFormat.Format8bppIndexed;
break;
case 16:
pixelFormat =
PixelFormat.Format16bppRgb555;
break;
case 24:
pixelFormat =
PixelFormat.Format24bppRgb;
break;
case 32:
pixelFormat =
PixelFormat.Format32bppRgb;
break;
case 48:
pixelFormat =
PixelFormat.Format48bppRgb;
break;
case 64:
pixelFormat =
PixelFormat.Format64bppArgb;
break;
default:
pixelFormat =
PixelFormat.Undefined;
break;
return pixelFormat;
below is the converted image for 8 pixelformat
below is the Actual image
Please help me to find the solution.
Thanks in Advance,
 Madhava Reddy and Madhu

Hi ,
We got below errors in the screen shots inserted.
MemoryStream msEVPict1 = new MemoryStream(buffer);
EVPict.pDIB.ImageBitmap = new Bitmap(msEVPict1);
 MemoryStream
ms1 = new
MemoryStream(buffer);
System.Drawing.Image
img = Image
.FromStream(ms1);
Thanks,
Madhu & Madhav

Similar Messages

  • SQLServer to oracle migration. Issue with table having image data.

    Hi,
    I am using the SQL Developer version 1.5.0.53 Build MAIN-53.38. I am trying to migrate from sql server database to oracle. Sql server database version is 2005 and oracle database version is 10g (10.1.0.2 and 10.2.0.3). Both Oracle and Sql server databases are on windows-xp.
    Everything (including data) migrated well except for the one table having blob (oracle) and image(sqlserver). I am getting the following error in sql developer while migrating data for the blob from sql server to oracle.
    Data Move information:Rows : 497 Errors: 10278
    Commit failed: Closed Connection
    Must be logged on to server
    [POCRepository].[td].[REPOSITORY] Closed Connection
    Io exception: Software caused connection abort: socket write error
    [POCRepository].[td].[REPOSITORY] OALL8 is in an inconsistent state
    No more data to read from socket
    [POCRepository].[td].[REPOSITORY] No more data to read from socket
    Inserting ' ' into column td_POCRepository.REPOSITORY.RP_DATA (Row number 498)
    I have created sqldeveloper.cmd file as suggested in other threads and I am using the same java provided with SQL Developer 1.5.0.53.
    The database alertsid.log shows the following error messages for this activity.
    ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [0x34EF9E5] [] [] [] []
    ORA-00600: internal error code, arguments: [kghasp1], [0x5F3B718], [], [], [], [], [], []
    ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [0x34EF9E5] [] [] [] []
    The error ORA-00600[kghasp1] refers to the problem with heap memory. I also restarted the database and tried the data migration for only this table but with the same error.
    I tried it on both 10g release1 and 10g release 2.
    Can someone please help me in resolving this issue.
    Thanks
    Raghavendra

    Hi Raghavendra,
    Are you saying the Microsoft SQL Server bcp dump of image data failed? It has been tested, it results in a hex dump rather than a binary dump, hence the clob to blob, and hextoraw workaround.
    What are the version numbers and what is the reproducible test case?
    -Turloch
    Note that the clob to blob process is automated:
    Tools->preferences->Migration->Generation Options->General Options->Generate Stored Procedure for Migrate Blobs Offline
    From Help:
    Generate Stored Procedure for Migrate Blobs Offline: Causes a stored procedure named CLOBtoBLOB_sqldeveloper (with execute access granted to public) to be created if the schema contains a BLOB (binary large object); this procedure is automatically called if you perform an offline capture. If this option is not checked, you will need to use the manual workaround described in Populating the Destination Database Using the Data Files. (After the offline capture, you can delete the CLOBtoBLOB_sqldeveloper procedure or remove execute access from public.)

  • Issue with creating a proxy assembly for WCF services

    Hi
    I am in the process of creating a proxy assembly for WCF services (Project Server 2010) and followed instructions as per below URL
    http://msdn.microsoft.com/en-us/library/ff621594.aspx#pj14_CreateProxyAssembly_UsingWebConfig
    Getting an error when i ran GenWCFProxyAssembly.cmd in Visual studio command prompt as well as DOS command prompt
    Please make a note, i have unzipped Source.zip under Documentation\Intellisense\WCF (path )
    Did i missed out any thing
    Kindly help me with this, trying to do this for the past 5 days
    Regards
    Santosh

    Issue has been resolved after adding environment variable for sn.exe
    Regards
    Santosh

  • Compatibility issues with AppleWorks 6.2.2 for Windows and Windows XP?

    For several years I have used AppleWorks for Windows version 6.2.2 with Windows 98. This summer my school upgraded me from W-98 to W-XP.
    On the new machine, I have found that text boxes in draw documents are locked and I cannot edit or move them or unlock them. I find that I have the same issue with an XP computer at home, but I can copy the same file to a W98 machine and everything works as it always did.
    Apple says that AppleWorks 6.2.2. is compatible with XP, but I wonder if that is completely correct.
    Does anyone have any insight?
    Thanks

    I was trying to test this for you in AppleWorks 6 Windows XP in Parallels on my MacBook Pro, but each time I tried to open a draw file I had originally create on my Mac, AppleWorks 6 for Windows crashed.
    I tried another, smaller draw document & it opens without problems & I can move the objects around. I'd suggest deleting the AppleWorks preferences, but I don't know where they are in Windows XP.

  • Issue with creating receipts(using interface) for a PO with multiple lines

    Hi,
    We have a receipts creation program which creates creates receipts.
    The issue is, if the PO contains 2 lines then the program creates receipts for only 1 line.Can someone suggest a solution for the same.
    Issue in Detail:
    The program works as follows
    - Populate rcv_header_interface table for Po Line#1 and Line#2
    - Populate rcv_transactions_interface table for Po Line#1 and Line#2
    - Invoke oracle std 'Receivogn Transaction Processor' program
    -Check for Receipt Number generated in the base table rcv_shipment_headers
    When we query the rcv_shipment_headers table, we found receipt_number is created for only Line#1.
    The data written to interaface table are as follows
    rcv_header_interface
    header_interface_id - sequence value
    GROUP_ID - sequence value
    Processing_status_code - 'PENDING'
    Receipt_source_code - 'VENDOR'
    transaction_type - 'NEW'
    vendor_name - <<derived from Po>>
    validation_flag -'Y'
    expected_receipt_date - current date
    WHO clolumns
    rcv_transactions_interface
    interface_transaction_id - seq value
    GROUP_ID - <<as header one>>
    header_interface_id - <<header data>>
    transaction_type - 'RECEIVE'
    transaction_date - current date
    processing_status_code - 'PENDING'
    processing_mode_code - 'BATCH'
    transaction_status_code - 'PENDING'
    employee_id - agent Id of PO,
    po_header_id - <<derived from Po>>
    po_line_id - <<derived from Po>>
    po_line_location_id - <<derived from Po>>
    validation_flag - 'Y'
    source_document_code 'PO',
    to_organization_code - NULL,
    expected_receipt_date - sysdate + 3
    Document_line_num - 1
    auto_transact_code - 'DELIVER'
    receipt_source_code - 'VENDOR'
    vendor_name - <<derived from Po>>
    destination_type_code - 'EXPENSE'
    document_shipment_line_num - 1
    amount - <<derived from Po>>
    po_distribution_id - <<derived from Po>>
    Have we missed any data tobe inserted into transactrin interface table because of which the transaction processor is geenrating receipt for Line#1 only?
    Thanks,
    Kamath.

    Hi,
    I have the same problem just now.
    Have you found some solutions about it ?
    thx
    Luigi

  • Issue with pasting text when saving for web and resizing

    This seems to be a very specific problem in PS CC 14.2.1 Mac.
    I have text in the clipboard.
    I go "SAVE FOR WEB" then  "SAVE . . ."
    I can then paste my name into the "Save As" name dialog.
    BUT
    If I I go "SAVE FOR WEB" then change the size of the file in the Image Size Box before I "SAVE . . ." I can no longer paste text in the naming dialog box.
    I haven't tried this for every permutation in the Save For Web dialog, but saving optimized as JPEG is what I'm having trouble with.
    I believe this is a bug.

    What might be happening is after you change the image size in the save for web dialog, one of the size fields is still highlighted, so when you paste
    in the save as dialog, the name is actually being pasted in one of the size fields in the main save for web dialog.
    After you change the size in the save for web dialog press the enter/return key and then see if pasting into the name field of the save dialog in save for web works.

  • .Issue with creating a photo book in Iphoto error message states some frames are missing images, but I've checked each one and from I can see they are all filled in. It won't let my buy the book though

    Having an Issue with Creating a photo Book in Iphoto. I continue to get an error message when clicking on "Buy Book" The error indicates that I'm missing a frame or frames from the book. I've checked this many times and cannot locate the issue. The book appears to be complete from my perspective. What can I do now? I worked very hard on this and would hate to lose it all.

    How did you check the book? Did you preview it?
    See:
    iPhoto, Aperture: Previewing an order in iPhoto or Aperture
    Is that the message?
    "your book seems to have frames on one or more pages that do not contain photos. You must either change the layout of those pages or place photos in those frames before you can buy this book."
    The most common reason for this error is, that you have used a page layout that needs a background photo and you have not yet added the backdrop. Then the book is still showing some default grayscale image.
    Check, if one of your page layouts is using this background:
    Then you need to add a photo to the background of the page.

  • I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be

    I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be selected. Any thoughts? TIA

    Greyed imaged in the Import dialog box mean you have already imported the photos into Lightroom, so there is no need and no benefit to importing them a second time.
    Just go to the Library module, search for the desired photos, and resume working on these photos.

  • System Image Utility - Issues with making bootable images

    During the image creation process for a Netboot, the System Image Utility reports an error. I've included the log file (everything before the removal of the bad image below).
    ------------Begin Log File --------------
    2006-06-02 13:19:25 -0400 Initiating user authentication
    2006-06-02 13:19:28 -0400 Image creation in progress
    2006-06-02 13:19:28 -0400 Starting image creation
    newfs_hfs:
    2006-06-02 14:10:30 -0400 b=400: bitmap clump size is too small
    --------------End Log File--------------------
    I have no issue creating images from restore disk sets (that shipped with machines) or retail masters of various OS's. This issue seems to be related to the particular drives I am trying to create images from.
    The drives that give me this error are hardwarily OK and the software works great. I can boot from these drives and have no issues with the machines imaged from them after the fact. I just want to Netboot off of these so I don't have to lug a million drives around...
    Any clue?

    i know that was the case in Leopard and Snow Leopard but i just mounted a leopard image to create a new netrestore on my lion server.  i was not able to boot any of my images created on Leopard or SL when running Lion Server.  I assume i need to recreate the images on Lion.  Right now my Lion server is using a leopard image as the source to create a netrestore i can push on the Lion server.

  • Issue with Oracle LONG RAW data type

    Hi All,
    I am facing some issues with Oracle LONG RAW DATA Type.
    We are using Oracle 9IR2 Database.
    I got a table having LONG RAW column and I need to transfer the same into another table having LONG RAW column.
    When I tried using INSERT INTO SELECT * command (or) CREATE TABLE as select * , it is throwing ORA-00997: illegal use of LONG datatype.
    I have gone through some docs and found we should not use LONG RAW using these operations.
    So I did some basic PLSQL block given below and I was able to insert most of the records. But records where the LONG RAW file is like 7O kb, the inserting is faliling.
    I tried to convert LONG RAW to BLOB and again for the record where the LONG RAW is big in size I am getting (ORA-06502: PL/SQL: numeric or value error) error.
    Appreciate if anyone can help me out here.
    DECLARE
    Y LONG RAW;
    BEGIN
    FOR REC IN (SELECT * FROM TRU_INT.TERRITORY WHERE TERRITORYSEQ=488480 ORDER BY TERRITORYSEQ ) LOOP
    INSERT INTO TRU_CMP.TERRITORY
    BUSINESSUNITSEQ, COMPELEMENTLIFETIMEID, COMPONENTIMAGE, DESCRIPTION, ENDPERIOD, GENERATION, NAME, STARTPERIOD, TERRITORYSEQ
    VALUES
    REC.BUSINESSUNITSEQ, REC.COMPELEMENTLIFETIMEID, REC.COMPONENTIMAGE, REC.DESCRIPTION, REC.ENDPERIOD, REC.GENERATION, REC.NAME,
    REC.STARTPERIOD, REC.TERRITORYSEQ
    END LOOP;
    END;
    /

    Maddy wrote:
    Hi All,
    I am facing some issues with Oracle LONG RAW DATA Type.
    We are using Oracle 9IR2 Database.
    I got a table having LONG RAW column and I need to transfer the same into another table having LONG RAW column.
    When I tried using INSERT INTO SELECT * command (or) CREATE TABLE as select * , it is throwing ORA-00997: illegal use of LONG datatype.
    I have gone through some docs and found we should not use LONG RAW using these operations.
    So I did some basic PLSQL block given below and I was able to insert most of the records. But records where the LONG RAW file is like 7O kb, the inserting is faliling.
    I tried to convert LONG RAW to BLOB and again for the record where the LONG RAW is big in size I am getting (ORA-06502: PL/SQL: numeric or value error) error.
    Appreciate if anyone can help me out here.
    DECLARE
    Y LONG RAW;
    BEGIN
    FOR REC IN (SELECT * FROM TRU_INT.TERRITORY WHERE TERRITORYSEQ=488480 ORDER BY TERRITORYSEQ ) LOOP
    INSERT INTO TRU_CMP.TERRITORY
    BUSINESSUNITSEQ, COMPELEMENTLIFETIMEID, COMPONENTIMAGE, DESCRIPTION, ENDPERIOD, GENERATION, NAME, STARTPERIOD, TERRITORYSEQ
    VALUES
    REC.BUSINESSUNITSEQ, REC.COMPELEMENTLIFETIMEID, REC.COMPONENTIMAGE, REC.DESCRIPTION, REC.ENDPERIOD, REC.GENERATION, REC.NAME,
    REC.STARTPERIOD, REC.TERRITORYSEQ
    END LOOP;
    END;
    /below might work
    12:06:23 SQL> help copy
    COPY
    Copies data from a query to a table in the same or another
    database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    COPY {FROM database | TO database | FROM database TO database}
                {APPEND|CREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    where database has the following syntax:
         username[/password]@connect_identifier

  • Issue with Creating Forecast Profiles/Forecasting

    Hello Experts,
    We are facing an issue with creating forecast profiles.
    We have two FYVs defined in our system, one with 52/53 fiscal weeks (Fiscal Variant W1) and the other with 12 fiscal months (FYV M1), Our storage buckets profile (STP) uses W1,  since we have many dataviews that use W1 as the FYV in the attached Planning buckets profile(PBP). We also have dataviews that display in fiscal months (use FYV M1 in the attached PBP), data from Fiscal weeks will be aggregated and shown in Fiscal months . We need to do forecasting using FYV M1, that is forecast in Fiscal Months , but since the storage bucket profile has W1 which is used in the Planning Area config. We are unable to create any Forecast profiles with FYV M1 . Please note that we cannot use M1 in STP because when we used M1 in STP, we could not create  dataviews in fiscal weeks (using W1)
    1. Is there any way we can forecast using M1 while having assinged W1 to the Planning area/STP ?
    2. OR we are willing to assing M1 to PA, provided we can use W1 in some of the dataviews, unfortunately we were unable to do this, though the vice versa is possible i,e. we could have W1 in STP and M1 in some of the related PBPs/ Weekly Dataviews.
    Please let me know if any of these are possible or if there is any alternative way to do forecasting in Fisc Months.
    Thanks
    Tej

    Hi,
    You are correct, the Storage bucket profile always has to be at a detailed level. Time bucket profile can be at higher levels like monthly, quarterly etc.,
    Coming to the root of your problem, which is you are unable to forecast at a level other that what is specified in your Storage bucket profile, unfortunately the answer is no.
    You can do a forecast only at the level at which the data is stored and not at the level at which the data is viewed.
    One work around for this is to create an additional planning area with the same MPOS and this addl PA can contain only those bare minimum KF required for your forecast. After you generate your forecast, you can copy it to your Weeks based PA and then proceed from there. This copy of KF between PA is much faster as it will happen at LC level and should not cause time delays.
    NOTE - You have to exercise caution when you are using 2 periodicities i.e., weeks and months, if you are using standard SAP calendar then you are good to go. If you are creating custom Fiscal variants pls ensure the start and end of a month is same in both the weekly and monthly variants. Failing which, there will be mismatch of data between the two dataviews.
    Hope this helps.
    Thanks
    Mani Suresh

  • Authorization Issue in creating HR Master data through PA40

    Hi,
    I am facing an issue while creating HR master data thru PA40. On the first screen, I select Action Type Hire, put personnel area IN01,EE Group 1, EE Subgroup N2 and Execute. It takes me to the next screen. there I put all the information required i.e., Personeel No., Start date, Title, Last name, First name, Date of Birth, Action Type (Hire), Reason of Action 06, position 40208, Personnel Area In01, Personnel Sub area 0001. when I save it, It gives me an error No Authorization to maintain Actions 01 exists  I have SAP_ALL.
    Any idea why this error is coming?? Same setting is running fine in another client.
    Thanks,
    Parul

    Hi,
    On the same screen where error is coming type tcode-SU53 this will display if still some object is missing for authorisation.Then give that object to your basis guy to include in ur role.
    thanks
    Deepa

  • How to create customer master data for walking customer in retail

    hi experts !!!!!!
    for retail industry e.g books trading industry
    how to create customer master data for walking customer in retail
    its dummy or one time customer
    if i create one time customer then same customer number can i use for every new order and every new customer how ?????
    thanks

    Dear Hanumant,
    As per my view,,
    You can use one time customer functionality to full fill your requirement.
    When you create sales order with one time customer system take you to the customer data maintanence screen through that you can maintain the one time customer data.
    Same one time customer number you can use for every new order through maintaining different data.
    I hope this will help you,
    Regards,
    Murali.
    Edited by: Murali Mohan.Tallapaneni on Dec 19, 2008 6:08 AM

  • Issues with Safari 3.0.1 for windows

    Issues with Safari 3.0.1 for windows (at work):
    Lenovo T60 with intel core duo T7200 @2.00Ghz plus additional monitor (Lenovo ThinkVision) in extended desktop mode running Windows XP Pro 2002, SP2
    1. Taskbar is configured to autohide: when Safari is the top (active) window, it remains on top. If the taskbar pops up, it does so behind the Safari window, because I cannot see it.
    2. If an open Safari window is dragged to the external (secondary) monitor, then maximized, it disappears to the side. It is not closed. I can still find it via Alt-tab or in the task bar and can, by right-clicking ‘Move’ from the taskbar use the arrow keys to move the window back into place. Clicking to reduce the window, then re-maximizing leads to the window disappearing to the side again.
    3. In general my impression is that this does not function at a ‘beta’ level, but more of an ‘alpha’ level. Still very buggy.
    Jcw
    iMacIntel Duo 2Gh   Mac OS X (10.4.7)   1G-RAM, 250vRAM
    iMacIntel Duo 2Gh   Mac OS X (10.4.7)   1G-RAM, 250vRAM

    This is a beta...thats why they give you the option to report probs via the bug icon. Since you are having these probs try and report them, I am not sure if apple has the time to scan these forums to try and find the big probs that people are having. So unless you report bugs, (and wait until the final realease) then they might never get noticed and or fixed.

  • I'm having a huge issue with itunes locating my missing files..and it's too many for me to locate 1 by 1..It says I'm missing over 3,00 songs and They are all in my music folder..What can I do to fix this issue?

    I'm having a huge issue with itunes locating my missing files..and it's too many for me to locate 1 by 1..It says I'm missing over 3,000 songs and They are all in my music folder..What can I do to fix this issue? I've looked at all the tutorials on youtube and none of it works. I recently got a new computer and I Back-Up all my music and itunes playlist and I import it on my new computer with the new itunes and I go to play a few songs, it says I'm missing them I locate a few but it's still like 3,000 missing and again they are all on the computer and in one folder..Please Help !

    I did that and nothing changed half my songs still have examination marks beside them
    I also just tried dragging my folder of music int he playlist and it duplicated all of my songs? My playlist was at 5k now it's at 10k becuz of 3 duplicates of songs. Is there a way to delete multiple duplicate files?

Maybe you are looking for

  • 3.0.0-665 - Export DDL is empty

    I have a relational model in DM and select menu Export / DDL File. I leave the selection Oracle Database 11g and click Generate. In the new dialog I leave everything as is (all tables and other items selected) and click OK. The result is just some co

  • Canon firewire camcorder and new macbook

    Hi, I just bought the new Macbook and to my great surprise I discovered I cannot connect my Canon Camcorder because there is no firewire port. Does anyone have any suggestions? (buying a new camcorder is not an option) If there is no solution to this

  • Contact name is wrong in the invoice print out

    Hi folks, contact person name is wrong in the invoice pint out,but in sales doc the sales group number and name is correct. what is the solution for tha above issue? Regards srinivas

  • Deadlock on RAC

    Hello All, I am using Oracle 10g RAC. I facing some dead locks in the db, I checked the alert log for both instances and i did not find any ORA-00060 error. Is there other ora error to search it inside the alert log to check dead locks for RAC enviro

  • Alternative to Palm Desktop?

    Hello, I bought a used Tungsten E on eBay. I find the Palm Desktop application OK overall, but there are a couple of things I don't like about it: - Apparently, it's not possible to create non-timed items in the Calendar and have them be moved automa