Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx4.public.one.com ([10.246.18.24])
	by mail6.local.one.com (Dovecot) with LMTP id jqtaAfH9T1jGFAAAsyOMew
	for <filtered@awaresystems.be>; Tue, 13 Dec 2016 15:20:36 +0000
X-HalOne-ID: b28e31e6-c147-11e6-9f6c-b82a72d0454d
Received: from mail-oi0-f47.google.com (unknown [209.85.218.47])
	by mx4.public.one.com (Halon Mail Gateway) with ESMTPS
	for <filtered@awaresystems.be>; Tue, 13 Dec 2016 15:20:36 +0000 (UTC)
Received: by mail-oi0-f47.google.com with SMTP id v84so125605647oie.3
        for <filtered@awaresystems.be>; Tue, 13 Dec 2016 07:20:35 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :message-id:date:from:user-agent:mime-version:to:references
         :in-reply-to:subject:precedence:list-id:list-unsubscribe
         :list-archive:list-post:list-help:list-subscribe:mime-version:sender
         :errors-to;
        bh=41axIUdtGqvd8bKW5tA8dYnkuzIyE9DY4VodS9Pa0ZU=;
        b=FXgG+kOsLgTbHiUkuK2Zm31yQw82mQ6c6JZ5xCqmGJzcNV5PH8usQ5AChj5HTyJ6G1
         wyKRoRlnnyYU1lW+m4K+g6UwDzp2RjRr5L2trumV29Wa7tBN8OimSpA8f+PaeH8F4EmC
         2ieLWH6DNrUh08OaaQKzGy3IP7r+9/7iqTEETeENbA101d7hrBdx0RoR5xnhrwZ5eUpN
         O1OMCcBMOYzuNZkYCmrVXiR7u9GuODoj19mAZ2biUO0obw679h7bLB1xvpLI8lm9MTYN
         uw/Xn9QNGM9vYD3fnmAPjALo72JwVtSVibcUDIt2RopVjFsqh8orPGyOtp7hMPasX3E1
         EYog==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
X-Gm-Message-State: AKaTC00BOfbdGf1bN4Dokj1z9HHB6Kzb2D+Qe11jBajcBw5NKaOAD6IuDDqDyeWgudChD110O4xIWLv0HMc0kapoN11jmEQ=
X-Received: by 10.202.228.83 with SMTP id b80mr52939551oih.214.1481642434660;
        Tue, 13 Dec 2016 07:20:34 -0800 (PST)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.192.135 with SMTP id q129csp2219339oif;
        Tue, 13 Dec 2016 07:20:33 -0800 (PST)
X-Received: by 10.194.248.233 with SMTP id yp9mr3030644wjc.228.1481642433768;
        Tue, 13 Dec 2016 07:20:33 -0800 (PST)
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id e133si2678940wmf.127.2016.12.13.07.20.33;
        Tue, 13 Dec 2016 07:20:33 -0800 (PST)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 4153535C036;
	Tue, 13 Dec 2016 10:19:48 -0500 (EST)
Received: from polaris.osa.pri.ee (osa.pri.ee [213.219.84.188])
	by lists.maptools.org (Postfix) with ESMTP id DC70A35C034
	for <tiff@lists.maptools.org>; Tue, 13 Dec 2016 10:19:06 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
	by polaris.osa.pri.ee (Postfix) with ESMTP id D5BA66E69A
	for <tiff@lists.maptools.org>; Tue, 13 Dec 2016 17:19:05 +0200 (EET)
X-Virus-Scanned: amavisd-new at osa.pri.ee
Received: from polaris.osa.pri.ee ([127.0.0.1])
	by localhost (osa.pri.ee [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id pjrQ9gUhaSxh for <tiff@lists.maptools.org>;
	Tue, 13 Dec 2016 17:18:09 +0200 (EET)
Received: from [0.0.0.0] (polaris.osa.pri.ee [213.219.84.188])
	by polaris.osa.pri.ee (Postfix) with ESMTP id 1F7306E636
	for <tiff@lists.maptools.org>; Tue, 13 Dec 2016 17:18:09 +0200 (EET)
Message-ID: <58501130.60907@osa.pri.ee>
Date: Tue, 13 Dec 2016 17:18:08 +0200
From: Paavo Helde <paavo@osa.pri.ee>
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64;
	rv:25.8) Gecko/20151117 FossaMail/25.1.9
MIME-Version: 1.0
To: tiff@lists.maptools.org
References: <AD5C390BCA739C4498464770B3930E3806856D58@ROHEX02.rohmann.de>
In-Reply-To: <AD5C390BCA739C4498464770B3930E3806856D58@ROHEX02.rohmann.de>
Subject: Re: [Tiff] WinAPI, save screenshot into tiff
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0491879210=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

This is a multi-part message in MIME format.
--===============0491879210==
Content-Type: multipart/alternative;
 boundary="------------000605050903020906000607"

This is a multi-part message in MIME format.
--------------000605050903020906000607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


On 13.12.2016 16:42, Urbach, Marcel [Rohmann GmbH] wrote:
>
> Hello Guys
>
> I want to capture a screenshot by using winapi only (no MFC wanted) 
> and save it as bitmap into a tiff file.
>
> The screen is captured correctly, but it looks like the bitmap is 
> saved 4 times into the tiff and now looks like this:
>
>         TIFFSetField( tiff, TIFFTAG_BITSPERSAMPLE, 
> info.bmiHeader.biBitCount );

biBitCount is 24 for typical RGB images, but you need to pass 8 to 
libtiff as this number is "per sample".

Cheers
Paavo


--------------000605050903020906000607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 13.12.2016 16:42, Urbach, Marcel
      [Rohmann GmbH] wrote:<br>
    </div>
    <blockquote
      cite="mid:AD5C390BCA739C4498464770B3930E3806856D58@ROHEX02.rohmann.de"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Hello Guys<o:p></o:p></p>
        <p class="MsoNormal"><span lang="EN-US">I want to capture a
            screenshot by using winapi only (no MFC wanted) and save it
            as bitmap into a tiff file.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">The screen is captured
            correctly, but it looks like the bitmap is saved 4 times
            into the tiff and now looks like this:<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <span style="font-size:9.5pt;font-family:Consolas;color:black"
          lang="EN-US"></span><span
          style="font-size:9.5pt;font-family:Consolas;color:black"
          lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIFFSetField( tiff,
        </span><span
          style="font-size:9.5pt;font-family:Consolas;color:#6F008A"
          lang="EN-US">TIFFTAG_BITSPERSAMPLE</span><span
          style="font-size:9.5pt;font-family:Consolas;color:black"
          lang="EN-US">, info.bmiHeader.biBitCount );</span></div>
    </blockquote>
    <br>
    biBitCount is 24 for typical RGB images, but you need to pass 8 to
    libtiff as this number is "per sample".<br>
    <br>
    Cheers<br>
    Paavo<br>
    <br>
  </body>
</html>

--------------000605050903020906000607--

--===============0491879210==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============0491879210==--
