<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[screenshot versenden ohne temp]]></title><description><![CDATA[<p>hallo, ich habe damit einen screen gemacht:</p>
<pre><code class="language-cpp">int Ctest::dc2bitmap(HDC hdc, int width, int height, char *filename)
{
    HDC hdc2;
    HBITMAP aBmp;
    BITMAPINFO bi;
    HGDIOBJ OldObj;
    void *dibvalues;
    HANDLE fileHandle;

    BITMAPFILEHEADER bmfh;
    BITMAPINFOHEADER bmih;
        DWORD bytes_write;
    DWORD bytes_written;

    hdc2=CreateCompatibleDC(hdc);

    ZeroMemory(&amp;bmih,sizeof(BITMAPINFOHEADER));
    bmih.biSize=sizeof(BITMAPINFOHEADER);
      bmih.biHeight=height;
        bmih.biWidth=width;
        bmih.biPlanes=1;
        bmih.biBitCount=24;
    bmih.biCompression=BI_RGB;
    bmih.biSizeImage = ((((bmih.biWidth * bmih.biBitCount) + 31) &amp; ~31) &gt;&gt; 3) * bmih.biHeight;
        bmih.biXPelsPerMeter = 0;
        bmih.biYPelsPerMeter = 0;
        bmih.biClrImportant = 0;
    //bmih.biSizeImage=(3*bmih.biHeight*bmih.biWidth);
        //bmih.biSizeImage = 0;

    bi.bmiHeader=bmih;

    aBmp=CreateDIBSection(hdc,&amp;bi,DIB_RGB_COLORS,(void**)&amp;dibvalues,NULL,NULL);

    if (aBmp==NULL)
    {
        OutputDebugString(&quot;CreateDIBSection failed!\n&quot;);
        return 0;
    }

    OldObj=SelectObject(hdc2,aBmp);
    BitBlt(hdc2,0,0,width,height,hdc,0,0,SRCCOPY);

    ZeroMemory(&amp;bmfh,sizeof(BITMAPFILEHEADER));
    bmfh.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
    bmfh.bfSize=(3*bmih.biHeight*bmih.biWidth)+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
        bmfh.bfType=0x4d42;
        bmfh.bfReserved1 = 0;
        bmfh.bfReserved2 = 0;

    fileHandle=CreateFile(filename,GENERIC_READ | GENERIC_WRITE,(DWORD)0,NULL,
                                                    CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,(HANDLE) NULL);
    if (fileHandle==INVALID_HANDLE_VALUE)
    {
        OutputDebugString(&quot;CreateFile failed!\n&quot;);
        return 0;
    }

        // Write the BITMAPFILEHEADER
        bytes_write=sizeof(BITMAPFILEHEADER);
    if (!WriteFile(fileHandle,(void*)&amp;bmfh,bytes_write,&amp;bytes_written,NULL))
    {
        OutputDebugString(&quot;WriteFile failed!\n&quot;);
        return 0;
    }

        //Write the BITMAPINFOHEADER
    bytes_write=sizeof(BITMAPINFOHEADER);
    if (!WriteFile(fileHandle,(void*)&amp;bmih,bytes_write,&amp;bytes_written,NULL))
    {
        OutputDebugString(&quot;WriteFile failed!\n&quot;);
        return 0;
    }

        //Write the Color Index Array???
        bytes_write=bmih.biSizeImage;//3*bmih.biHeight*bmih.biWidth;
    if (!WriteFile(fileHandle,(void*)dibvalues,bytes_write,&amp;bytes_written,NULL))
    {
        OutputDebugString(&quot;WriteFile failed!\n&quot;);
        return 0;
    }

    CloseHandle(fileHandle);

    DeleteObject(SelectObject(hdc2,OldObj));
    DeleteDC(hdc2);

    return 1;
}
</code></pre>
<p>meine frage ist jetzt, ob ich den Screenshot irgendwie mit send() versenden kann, ohne ihn vorher zwischenzuspeichern (die .bmp zu erstellen)<br />
kann ich da irgendwie bitblt auf eine BITMAP variable machen und diese dann verschicken oder wie geht das? Wäre sehr dankbar für hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/223870/screenshot-versenden-ohne-temp</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 02:00:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/223870.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Oct 2008 05:58:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to screenshot versenden ohne temp on Thu, 02 Oct 2008 05:58:22 GMT]]></title><description><![CDATA[<p>hallo, ich habe damit einen screen gemacht:</p>
<pre><code class="language-cpp">int Ctest::dc2bitmap(HDC hdc, int width, int height, char *filename)
{
    HDC hdc2;
    HBITMAP aBmp;
    BITMAPINFO bi;
    HGDIOBJ OldObj;
    void *dibvalues;
    HANDLE fileHandle;

    BITMAPFILEHEADER bmfh;
    BITMAPINFOHEADER bmih;
        DWORD bytes_write;
    DWORD bytes_written;

    hdc2=CreateCompatibleDC(hdc);

    ZeroMemory(&amp;bmih,sizeof(BITMAPINFOHEADER));
    bmih.biSize=sizeof(BITMAPINFOHEADER);
      bmih.biHeight=height;
        bmih.biWidth=width;
        bmih.biPlanes=1;
        bmih.biBitCount=24;
    bmih.biCompression=BI_RGB;
    bmih.biSizeImage = ((((bmih.biWidth * bmih.biBitCount) + 31) &amp; ~31) &gt;&gt; 3) * bmih.biHeight;
        bmih.biXPelsPerMeter = 0;
        bmih.biYPelsPerMeter = 0;
        bmih.biClrImportant = 0;
    //bmih.biSizeImage=(3*bmih.biHeight*bmih.biWidth);
        //bmih.biSizeImage = 0;

    bi.bmiHeader=bmih;

    aBmp=CreateDIBSection(hdc,&amp;bi,DIB_RGB_COLORS,(void**)&amp;dibvalues,NULL,NULL);

    if (aBmp==NULL)
    {
        OutputDebugString(&quot;CreateDIBSection failed!\n&quot;);
        return 0;
    }

    OldObj=SelectObject(hdc2,aBmp);
    BitBlt(hdc2,0,0,width,height,hdc,0,0,SRCCOPY);

    ZeroMemory(&amp;bmfh,sizeof(BITMAPFILEHEADER));
    bmfh.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
    bmfh.bfSize=(3*bmih.biHeight*bmih.biWidth)+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
        bmfh.bfType=0x4d42;
        bmfh.bfReserved1 = 0;
        bmfh.bfReserved2 = 0;

    fileHandle=CreateFile(filename,GENERIC_READ | GENERIC_WRITE,(DWORD)0,NULL,
                                                    CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,(HANDLE) NULL);
    if (fileHandle==INVALID_HANDLE_VALUE)
    {
        OutputDebugString(&quot;CreateFile failed!\n&quot;);
        return 0;
    }

        // Write the BITMAPFILEHEADER
        bytes_write=sizeof(BITMAPFILEHEADER);
    if (!WriteFile(fileHandle,(void*)&amp;bmfh,bytes_write,&amp;bytes_written,NULL))
    {
        OutputDebugString(&quot;WriteFile failed!\n&quot;);
        return 0;
    }

        //Write the BITMAPINFOHEADER
    bytes_write=sizeof(BITMAPINFOHEADER);
    if (!WriteFile(fileHandle,(void*)&amp;bmih,bytes_write,&amp;bytes_written,NULL))
    {
        OutputDebugString(&quot;WriteFile failed!\n&quot;);
        return 0;
    }

        //Write the Color Index Array???
        bytes_write=bmih.biSizeImage;//3*bmih.biHeight*bmih.biWidth;
    if (!WriteFile(fileHandle,(void*)dibvalues,bytes_write,&amp;bytes_written,NULL))
    {
        OutputDebugString(&quot;WriteFile failed!\n&quot;);
        return 0;
    }

    CloseHandle(fileHandle);

    DeleteObject(SelectObject(hdc2,OldObj));
    DeleteDC(hdc2);

    return 1;
}
</code></pre>
<p>meine frage ist jetzt, ob ich den Screenshot irgendwie mit send() versenden kann, ohne ihn vorher zwischenzuspeichern (die .bmp zu erstellen)<br />
kann ich da irgendwie bitblt auf eine BITMAP variable machen und diese dann verschicken oder wie geht das? Wäre sehr dankbar für hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591833</guid><dc:creator><![CDATA[ausbildungsleiter]]></dc:creator><pubDate>Thu, 02 Oct 2008 05:58:22 GMT</pubDate></item><item><title><![CDATA[Reply to screenshot versenden ohne temp on Thu, 02 Oct 2008 06:17:49 GMT]]></title><description><![CDATA[<p>aBmp ist doch die Bimtap in Deinem Speicher! Du kommst nun auch an alle Daten der Bitmap!<br />
Was möchtst Du jetzt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591839</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591839</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 02 Oct 2008 06:17:49 GMT</pubDate></item><item><title><![CDATA[Reply to screenshot versenden ohne temp on Thu, 02 Oct 2008 06:55:54 GMT]]></title><description><![CDATA[<p>das problem ist, dass ich das bild zuerst mit cximage in ein jpg umwandeln muss jedoch auch im speicher.</p>
<pre><code class="language-cpp">// Converten für geringere Dateigröße
	CxImage  image;
	// bmp -&gt; jpg
	image.Load(szScreenName, CXIMAGE_FORMAT_BMP);
	if (image.IsValid()){
		if(!image.IsGrayScale()) image.IncreaseBpp(24);
			image.SetJpegQuality(50);
		image.Save(&quot;tmp.jpg&quot;,CXIMAGE_FORMAT_JPG);
	}
	return 0;
</code></pre>
<p>leider wird dabei das bild auch abgespeichert und wird geladen von datei</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591856</guid><dc:creator><![CDATA[ausbildungsleiter]]></dc:creator><pubDate>Thu, 02 Oct 2008 06:55:54 GMT</pubDate></item></channel></rss>