Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

TalSt

@TalSt
About
Posts
23
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Nlog for .Net compact
    T TalSt

    Hi, I finally wrote a wrapper for NLog .net compact... (2 years ago). It seems to work very well after so long time :)

    .NET (Core and Framework) tutorial csharp help question

  • Nlog for .Net compact
    T TalSt

    I am looking for logging code for .Net compact, for example writing to log file, msgbox amd so. thanks!

    .NET (Core and Framework) tutorial csharp help question

  • Nlog for .Net compact
    T TalSt

    Thanks, but I need specific information ;)

    .NET (Core and Framework) tutorial csharp help question

  • Nlog for .Net compact
    T TalSt

    Hello Do you know of any example for Nlog for .Net compact 3.5? Any help how to start working with Nlog for .Net compact? Thanks!

    .NET (Core and Framework) tutorial csharp help question

  • AsyncIO - how to use it?
    T TalSt

    Hi, I need to retrive a list from IP server. Do you know how to do it by AsyncIO? Even good referance will be great... Thanks! :confused:

    C / C++ / MFC sysadmin tutorial question

  • AsyncIO C++
    T TalSt

    Hi, I need to retrive a list from IP server. Do you know how to do it by AsyncIO? Thanks!

    ATL / WTL / STL c++ sysadmin tutorial question

  • Convert BYTE* array (unmanaged) to SAFEARRAY
    T TalSt

    Hello, Yes. You are right. The title is wrong. It should be: "converting from SAFEARRAY to BYTE[]". Do you know if the code is correct? Thanks! :)

    C / C++ / MFC csharp com data-structures question

  • Convert BYTE* array (unmanaged) to SAFEARRAY
    T TalSt

    SAFEARRAY* arr; int iRes = RestoreFactory(bstrPath, // this function is for c#com object &arr); // Copy SAFEARRAY* values to output int iSize; if ( arr != NULL ) { iSize = arr->rgsabound[0].cElements; BYTE *byteArr = new BYTE[iSize]; for (int i = 0; i < iSize; i++) { byteArr[i] = ((BYTE)((( char *)(*arr).pvData)[i])); } } The byteArr seems to be wrong! Is it the right convertion??? Thanks!

    C / C++ / MFC csharp com data-structures question

  • StretchBlt - logical units ?
    T TalSt

    Hello, I want to draw a BYTE* array on the screen by creating a bitmap and use StrechBlt function. The problem was that the origin point was not (top, left) but (bottom, left). I thought that it may be the StrechBlt function but finally I found that the problem is the creation of the bitmap from the BYTE* array. The fix is: m_bitmapInfo.bmiHeader.biHeight = -m_nImageHeight; // top-down DIB The height should be -. // Populate bitmapinfo header m_bitmapInfo.bmiHeader.biSize = m_nBitmapInfoSize; m_bitmapInfo.bmiHeader.biWidth = m_nImageWidth; m_bitmapInfo.bmiHeader.biHeight = -m_nImageHeight; // top-down DIB m_bitmapInfo.bmiHeader.biPlanes = 1; m_bitmapInfo.bmiHeader.biBitCount = BPP; m_bitmapInfo.bmiHeader.biSizeImage = m_nImageSize; m_bitmapInfo.bmiHeader.biCompression = BI_RGB; m_bitmapInfo.bmiHeader.biClrImportant = 0; m_bitmapInfo.bmiHeader.biClrUsed = 0; m_bitmapInfo.bmiHeader.biXPelsPerMeter = 0; m_bitmapInfo.bmiHeader.biYPelsPerMeter = 0; Thanks for all!

    C / C++ / MFC help question

  • StretchBlt - logical units ?
    T TalSt

    Hello, Do you know what it means logical units at the help (MSDN) of StretchBlt ? I found problem to define to origin at this function... Thanks! :confused:

    C / C++ / MFC help question

  • Drawing a bitmap on DC created by BYTE* array
    T TalSt

    Thanks! You are right, pbtImageArray is OUTPUT and not input. I change it to void* pbtImageArray and add: m_pbtImageArray = (BYTE*)pbtImageArray; As for the previuse reply: 1) Off course at my original code I add nResult and do all the checks!!! 2) I add initialization for all variables at bitmapinfo. Thanks you both! :laugh: :-D :) :rose:

    C / C++ / MFC graphics data-structures performance question

  • Drawing a bitmap on DC created by BYTE* array
    T TalSt

    I wrote the following lines in order to draw a bitamp on DC created by BYTE* array: #define BPP 32 // Initialize the bitmapinfo header int nBitmapInfoSize = sizeof(BITMAPINFOHEADER) ; memset(&m_bitmapInfo, 0, m_nBitmapInfoSize); // Save size for drawing later. int nBitPP = BPP / 8; int nImageWidth = nWidth; int nImageHeight = nHeight; int nImageSize = nImageWidth * nImageHeight * nBitPP; // Allocate memory for byte array and initialize it BYTE* pbtImageArray = new BYTE [nImageSize]; memset(m_pbtImageArray, 0x0000, nImageSize); for (int i = 0; i < nImageSize - nBitPP; i+=nBitPP) { pbtImageArray[i] = 0x0000; pbtImageArray[i+1] = 0x0000; pbtImageArray[i+2] = 255; pbtImageArray[i+3] = 0x0000; } // Populate bitmapinfo header BITMAPINFO bitmapInfo; // Bitmap info bitmapInfo.bmiHeader.biSize = nBitmapInfoSize; bitmapInfo.bmiHeader.biWidth = nImageWidth; bitmapInfo.bmiHeader.biHeight = nImageHeight; bitmapInfo.bmiHeader.biPlanes = 1; bitmapInfo.bmiHeader.biBitCount = BPP; bitmapInfo.bmiHeader.biSizeImage = nImageSize; bitmapInfo.bmiHeader.biCompression = BI_RGB; // Create bitamp HBITMAP hbmp = CreateDIBSection( pCDC->GetSafeHdc(), &bitmapInfo, DIB_RGB_COLORS, (void**)pbtImageArray, NULL, 0); HDC hBitmapDC = CreateCompatibleDC(pCDC->GetSafeHdc() ); HBITMAP hOldBitmap = (HBITMAP)SelectObject(hBitmapDC, hbmp); StretchBlt( pCDC->GetSafeHdc(), nWindowX, nWindowY, nWindowWidth, nWindowHeight, // Destination hBitmapDC , nRegionX, nRegionY, nRegionWidth, nRegionHeight, // Source SRCCOPY); SelectObject(m_hBitmapDC, hOldBitmap); Do you know why this draw black image and not my BYTE* array? Thanks!:rose:

    C / C++ / MFC graphics data-structures performance question

  • ATL
    T TalSt

    Do you know if I am using ATL classes, should I put any dll/lib at a computer without VC7 (for runtime)? thanks!

    C / C++ / MFC c++ question

  • Crash dump in vista
    T TalSt

    You may try to send this question to operating system form...

    C / C++ / MFC question csharp visual-studio debugging tutorial

  • Date validation?
    T TalSt

    Do you know how to check date validation? I use COleDateTime and at environment without VS7 - it is wrong!!! Do you know other calss for VC7 to check that? 1900-02-31 - wrong, 1900-02-28 - OK. Thanks!!! ;)

    C / C++ / MFC tutorial question workspace

  • How to distinguish between VISTA and XP by using a registry key?
    T TalSt

    Thanks!!! :laugh:

    C / C++ / MFC windows-admin tutorial question

  • How to distinguish between VISTA and XP by using a registry key?
    T TalSt

    Thanks a lot! :-D :)

    System Admin windows-admin tutorial question

  • How to distinguish between VISTA and XP by using a registry key?
    T TalSt

    Do you know what registry key says we are using XP or VISTA?

    System Admin windows-admin tutorial question

  • How to distinguish between VISTA and XP by using a registry key?
    T TalSt

    Hello, Do you know any registry key that says which Operating System we are using? Thanks! :doh:

    C / C++ / MFC windows-admin tutorial question

  • WinAPI
    T TalSt

    The taskbar should be 'not top most' when my application is running. I set it to 'not top most' at the InitInstance() and to 'top most' at the destructor. I can not change the mainform of the application to top most from some other reasons... thanks!

    C / C++ / MFC tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups