Josh Posted October 8, 2023 Share Posted October 8, 2023 Occasionally the editor will display a white square on one or more toolbar buttons. I'm not sure if this is a Win32 problem or a problem with the SVG rasterizer. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 8, 2023 Share Posted October 8, 2023 Yep, this happened to me too a few times. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Author Share Posted October 8, 2023 The problem is related to the GDI image. The SVG rasterizer is working correctly: Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Author Share Posted October 8, 2023 I replace Lock/Unlock bits with SetPixel and it seems to work correctly. No idea why but it doesn't seem any slower this way. #ifdef _WIN32 shared_ptr<Gdiplus::Bitmap> Pixmap::GetBitmap() { if (bitmap) return bitmap; auto pixmap = As<Pixmap>(); int format = PixelFormat32bppPARGB; int bpp = 4; switch (m_format) { case TEXTURE_BGRA: break; case TEXTURE_BGR: bpp = 3; format = PixelFormat24bppRGB; break; default: pixmap = Convert(TEXTURE_BGRA); if (pixmap == NULL) return NULL; break; } auto bitmap = std::make_shared<Gdiplus::Bitmap>(size.x, size.y, format); unsigned char pixel[4] = { 0,0,0,255 }; Gdiplus::Color color; /* Gdiplus::BitmapData data; Gdiplus::Rect rect = Gdiplus::Rect(0, 0, size.x, size.y); auto stat = bitmap->LockBits(&rect, Gdiplus::ImageLockMode::ImageLockModeWrite, format, &data); if (stat != Gdiplus::Status::Ok) return NULL; memcpy(data.Scan0, pixmap->pixels->Data(), pixmap->pixels->GetSize()); stat = bitmap->UnlockBits(&data); if (stat != Gdiplus::Status::Ok) return NULL; */ uint32_t rgba; for (int x = 0; x < size.x; ++x) { for (int y = 0; y < size.y; ++y) { rgba = pixmap->ReadPixel(x, y); if (format == TEXTURE_BGRA) rgba = Rgba(Blue(rgba), Green(rgba), Red(rgba), Alpha(rgba)); color.SetValue(rgba); bitmap->SetPixel(x, y, color); } } this->bitmap = bitmap; return bitmap; } #endif Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Author Share Posted October 8, 2023 Scratch that, I can still produce the error in this build...curiouser and curiouser 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Solution Josh Posted October 8, 2023 Author Solution Share Posted October 8, 2023 This might be fixed now. Let me know if you see it again after downloading the current build. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.