Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » ImageBuffer Paint problem
ImageBuffer Paint problem [message #18356] Wed, 24 September 2008 18:42 Go to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I have some problems with my Paint method where I simply draw an ImageBuffer. I always get the following error message after i drag the window to the border of the screen an move it a bit (so that it gets repainted)

Assertion failed in C:\upp\uppsrc\CtrlCore\Win32Proc.cpp, line 77
IsNull(sPainting)


I attached a very simple testcase.
Re: ImageBuffer Paint problem [message #18358 is a reply to message #18356] Wed, 24 September 2008 18:46 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
You are very likely hitting this issue:
http://www.ultimatepp.org/forum/index.php?t=msg&th=3262& amp; amp; amp;start=0&
edit: (I didn't even bother to check your source, sorry Wink ... if it's not related, I will feel ashamed for at least 15minutes, ok? Than again, you got reply in 4minutes, I'm like Pentium, maybe not right, but fast Wink Very Happy. )

[Updated on: Wed, 24 September 2008 18:48]

Report message to a moderator

Re: ImageBuffer Paint problem [message #18360 is a reply to message #18356] Wed, 24 September 2008 19:11 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Thank you for the fast answer Wink

It seems that this is the problem of the testcase but not of my real problem. Confused

But why can't I use an ImageBuffer as a member variable of a class? I still don't understand the actual problem.

I need a pointer to the image data so that i can manipulate it with a pointer. So I need an Image object and a pointer that that use the same area of memory. Is there another possibility if I can't use ImageBuffer?
Re: ImageBuffer Paint problem [message #18362 is a reply to message #18356] Wed, 24 September 2008 21:02 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hm, ok I think I found a solution even if it is not really nice imho.

It works like I want it if I use an ImageBuffer but for the drawing I use the following code:
Image i = buffer;
draw.DrawImage(0, 0, i);
buffer = i;
Re: ImageBuffer Paint problem [message #18363 is a reply to message #18362] Wed, 24 September 2008 21:52 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I think this is definitely quite confusing...

Anyway, let us say this strange requirement has its root in performance and implementation issues.

The main problem is that Image is sort of "immutable", which allows it to cache host platform resource handle. That is not possible with ImageBuffer, whose content can change at any moment.

If it would be supposed to work in "non-ugly" way, ImageBuffer <-> Image conversions would require the full copy of ImageBuffer pixels.

In practice, you should use ImageBuffer only as local variable, "Image content accesor". Or be very very careful...

Mirek
Previous Topic: Qtf enabled selectable label
Next Topic: How to Close Modal Dlg from Constructor?
Goto Forum:
  


Current Time: Thu Mar 28 12:57:34 CET 2024

Total time taken to generate the page: 0.01109 seconds