<?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[C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am using <code>GeUserArea::DrawBitmap()</code> to draw a 32-bit greyscale bitmap into a <code>GeUserArea</code> in a <code>GeDialog</code>. On macOS, the code works nicely in R20 - R25, but in C4D 2023, nothing happens. All my drawing operations in the <code>GeUserArea</code> work as expected, but the <code>DrawBitmap()</code> call does nothing.</p>
<p dir="auto">This is how I create the bitmap:</p>
<pre><code class="language-cpp">AutoAlloc&lt;BaseBitmap&gt; bitmap;
const maxon::Int32 pixelBytes = COLORBYTES_GRAYf;
const maxon::Int32 pixelBits = pixelBytes * 8;

if (bitmap-&gt;Init((maxon::Int32)_width, (maxon::Int32)_height, pixelBits, INITBITMAPFLAGS::GRAYSCALE) != IMAGERESULT::OK)
	return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION, "Could not initialize BaseBitmap!"_s);

auto populateBitmapWorker = [&amp;bitmap, pixelBytes] (maxon::Int z)
{
	iferr (maxon::Float32* bufferPtr = NewMem(maxon::Float32, _width))
		return;

	for (maxon::Int x = 0; x &lt; _width; ++x)
	{
		// Get value between 0.0 and 1.0
		const maxon::Float value = GetTheValue(x, z);
		bufferPtr[x] = (maxon::Float32)value;
	}
	bitmap-&gt;SetPixelCnt(0, (Int32)z, (Int32)_width, (UChar*)bufferPtr, pixelBytes, COLORMODE::GRAYf, PIXELCNT::NONE);
	DeleteMem(bufferPtr);
};
maxon::ParallelFor::Dynamic(0, _height, populateBitmapWorker);
</code></pre>
<p dir="auto">Calling <code>ShowBitmap()</code> to display the bitmap in the Picture Viewer works fine, it looks exactly as I'd expect.</p>
<p dir="auto">Now, in <code>GeUserArea::DrawMsg()</code> I want to draw the bitmap in a <code>GeUserArea</code> in a <code>GeDialog</code>.<br />
<code>theBitmapPtr</code> has been allocated, initialised, and populated by the above shown code.</p>
<pre><code class="language-cpp">OffScreenOn(); 
SetClippingRegion(x1, y1, x2, y2);

// Fill background with standard background color
DrawSetPen(COLOR_BG);
DrawRectangle(0, 0, GetWidth(), GetHeight());

// Draw the bitmap
DrawBitmap(theBitmapPtr, 20, 0, 500, 500, 0, 0, theBitmapPtr-&gt;GetBw(), theBitmapPtr-&gt;GetBh(), BMP_NORMAL);
</code></pre>
<p dir="auto">Again, this works perfectly fine in R25 and older releases. After drawing the bitmap, I also draw some text, and that text still appears in C4D 2023. Just the bitmap is missing. Any ideas?</p>
<p dir="auto">Sporadically (but not always), I get messages like this in the Xcode console:</p>
<pre><code class="language-txt">2023-09-12 15:07:53.549687+0200 Cinema 4D[5384:86871] [net.maxon.cinema4d] CGImageCreate: invalid image bits/component: 8 bits/pixel 32 alpha info = kCGImageAlphaNoneSkipFirst
outofmemory [mac_gui_tools.mm(291)]
</code></pre>
<p dir="auto"><s>Also, it seems (but I'll double check to validate) that it only fails on macOS, but works on Windows.</s><br />
In deed, it works on Windows, but not on macOS.</p>
<p dir="auto">Thanks in advance!</p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/topic/15021/c4d-2023-on-macos-geuserarea-drawbitmap-not-working-anymore</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 17:41:33 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/15021.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Sep 2023 13:28:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Mon, 18 Sep 2023 22:23:45 GMT]]></title><description><![CDATA[<p dir="auto">I already tried using 8 bit greyscale. Still doesn't work in 2023 on macOS, but on the other C4D/OS combinations.</p>
<p dir="auto">Will try RGB, too.</p>
<p dir="auto">If that doesn't work either, I'll be back and try to write a minimal example.</p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/post/72472</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72472</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Mon, 18 Sep 2023 22:23:45 GMT</pubDate></item><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Mon, 18 Sep 2023 11:28:59 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fwilleke80">@<bdi>fwilleke80</bdi></a>,</p>
<p dir="auto">It could very well be that this is a bug, but it is still faster for you to test if changing these few lines will fix it than me unwinding your project.</p>
<p dir="auto">Alternatively, you could provide a compileable project as lined out in our guidelines. Because to check your code, I would have to implement quite a lot of stuff around it right now. The more users provide us with such fragments of code, the more I will ask them to test things themselves. When you provide me with a zip from the get-go which I can either include into one of our solutions or which even better itself contains a solution, I am much more inclined to quickly give it a spin myself.</p>
<p dir="auto">Here I would have first to implement a <code>GeUserArea</code> and a <code>GeDialog</code> and in doing so risk changing the outcome of any tests.</p>
<p dir="auto">For simple things and beginners, I sometimes do that - infer code and intentions. But the problems of expert users such as yourself usually are too complex that I could just easily do that all the time without having exhausted other routes first. And this does not even touch the problem that users show us a snippet and then five lines below that cause a problem they do not show us, with us then running in circles trying to reproduce the problem.</p>
<p dir="auto">Long story short and a bit blunt: When you want quick answers, provide compileable and executable code.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/72467</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72467</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 18 Sep 2023 11:28:59 GMT</pubDate></item><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Mon, 18 Sep 2023 09:19:13 GMT]]></title><description><![CDATA[<p dir="auto">By the way, interesting fact: Using the 32-Bit greyscale <code>BaseBitmap</code> in a <code>BITMAPBUTTON</code> CustomGUI works flawlessly. I would have expected it also uses a <code>GeUserArea</code> internally to draw the bitmap. So, if it was a "known limitation" in the <code>GeUserArea</code>/<code>ImageInterface</code>, it shouldn't draw there either, should it?</p>
<p dir="auto">I still suspect a bug <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61b.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--stuck_out_tongue" style="height:23px;width:auto;vertical-align:middle" title=":-P" alt="😛" /></p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/post/72463</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72463</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Mon, 18 Sep 2023 09:19:13 GMT</pubDate></item><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Thu, 14 Sep 2023 09:00:21 GMT]]></title><description><![CDATA[<p dir="auto">That would be the first time ever that Windows code is more clever than macOS, especially when it comes to media <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f601.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--grin" style="height:23px;width:auto;vertical-align:middle" title="😁" alt="😁" /></p>
<p dir="auto">I’d say, if the API offers a format COLORBYTES_GRAYf, it should work. The fact that it fails only on one OS and in one C4D release does hint to a bug.</p>
<p dir="auto">However, I’ll try going 8 Bit <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title="🙂" alt="🙂" /></p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/post/72430</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72430</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Thu, 14 Sep 2023 09:00:21 GMT</pubDate></item><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Wed, 13 Sep 2023 14:55:40 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fwilleke80">@<bdi>fwilleke80</bdi></a>,</p>
<p dir="auto">It could very well be a bug, but you should keep in mind that some code of the image API is OS dependent. It could simply be that the Windows code is a bit cleverer when interpreting malformed inputs.</p>
<p dir="auto">My hunch would be more "known" limitation since the bitmaps were conceived much more  simplistically in the <code>GeUserArea/BaseBitmap</code> days as they were in <code>ImageInterface</code> days.</p>
<p dir="auto">But be reassured, when you still have problems or there is a bug, we will have a look at it.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/72429</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72429</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Wed, 13 Sep 2023 14:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Wed, 13 Sep 2023 13:55:05 GMT]]></title><description><![CDATA[<p dir="auto">Thank you Ferdinand! Yes, going 8 bits RGB or greyscale is the next thing I‘ll try.</p>
<p dir="auto">It’s just strange that it works with R25, and on Windows in 2023, too. Only macOS with C4D 2023 is affected by this. Therefore, I respectfully suspect it’s a bug <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=";-)" alt="😉" /></p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/post/72428</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72428</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Wed, 13 Sep 2023 13:55:05 GMT</pubDate></item><item><title><![CDATA[Reply to C4D 2023 on macOS: GeUserArea::DrawBitmap() not working anymore? on Wed, 13 Sep 2023 08:15:33 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fwilleke80">@<bdi>fwilleke80</bdi></a>,</p>
<p dir="auto">Thank you for reaching out to us. Have you tried using a non-floating point and a non-gray-space mode? Because I am not so sure that the ancient <code>GeUserArea</code> <a href="https://developers.maxon.net/docs/cpp/2023_2/group___b_m_p.html" target="_blank" rel="noopener noreferrer nofollow ugc">supports any of them</a>.</p>
<p dir="auto">You create there a bitmap with a singular four bytes channel, i.e., what falls into the domain of "HDR". The problem with all this is that <code>BaseBitmap</code> these days is only a thin wrapper for <a href="https://developers.maxon.net/docs/cpp/2023_2/classmaxon_1_1_image_interface.html" target="_blank" rel="noopener noreferrer nofollow ugc">ImageInterface</a> and not everything in the classic API supports the complexity of the underlying maxon API. <a href="https://developers.maxon.net/forum/topic/14420/sdk-typo-discrepancy-bitmap-init-regarding-bitdepth/6" target="_blank" rel="noopener noreferrer nofollow ugc">Here</a> we had a bit of a talk about the oddities of <code>BaseBitmap</code>.</p>
<p dir="auto">I would suggest using <code>COLORBYTES_RGB</code> and just writing the same value to all channels. Another thing you could do, is also use the underlying <code>ImageRef</code> interface of your bitmap directly, but that is not so fun to do.</p>
<p dir="auto">If you still have problems in RGB mode, drop me a note, I will have a look.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/72423</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72423</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Wed, 13 Sep 2023 08:15:33 GMT</pubDate></item></channel></rss>