Hello everybody,
Is there any way to create larger than 32000px height Image... I need to create 150000-200000 pixel height photos...
Any tricks to do this?
Thaks!
CreateImage() Limit?
Re: CreateImage() Limit?
A picture that size in 32 bits per pixel would require over a Terabyte of memoryarma wrote:Is there any way to create larger than 32000px height Image... I need to create 150000-200000 pixel height photos
Perhaps there may be some useful information in these links regarding this common problem:
http://www.purebasic.fr/english/viewtop ... 13&t=66710
http://www.purebasic.fr/english/viewtop ... 13&t=66050
http://www.purebasic.fr/english/viewtop ... 13&t=58655
http://www.purebasic.fr/english/viewtop ... 13&t=57438
http://www.purebasic.fr/english/viewtop ... 12&t=56288
Re: CreateImage() Limit?
No no you did missunderstand me, I need 150000-200000pixel in one direction,
for example 1024x200000. or 200000x800, etc.
Then it costs memory around 1GB of RAM. Also I dont have memory problem,
I have 128GB RAM. But i need to create that kind of resulation photos... If possible.
If NOT, i find external solutions. But that solutions makes my program runs slower
for example 1024x200000. or 200000x800, etc.
Then it costs memory around 1GB of RAM. Also I dont have memory problem,
I have 128GB RAM. But i need to create that kind of resulation photos... If possible.
If NOT, i find external solutions. But that solutions makes my program runs slower
Re: CreateImage() Limit?
You can create an image at large scale as long as it fit in less than 2 GB.
Just disable debugger around canvas or image creation:
The limiting factor here is the CanvasGadget.
It can't be larger than 32768 in either direction.
Be carefull at the upper end of canvas/image size.
The handle starts to be unreliable as indicator for a successful created canvas/image when it approches the maximum usable memory.
Just disable debugger around canvas or image creation:
Code: Select all
#maxH=100000; Change size here
Procedure DrawSomething()
StartDrawing(CanvasOutput(2))
LineXY(0, 0, 800, #maxH, #Red)
StopDrawing()
EndProcedure
Procedure ClrSomething()
StartDrawing(CanvasOutput(2))
Box(0, 0, 800, #maxH, #White)
StopDrawing()
EndProcedure
OpenWindow(1, 10, 10, 1024, 758, "")
DisableDebugger
hScrollArea=ScrollAreaGadget(1, 0, 0, 824, WindowHeight(1), 800, #maxH)
hCanvas=CanvasGadget(2, 0, 0, 800, #maxH)
CloseGadgetList()
EnableDebugger
Debug hCanvas
Debug hScrollArea
If hCanvas
ButtonGadget(3, 900, 10, 48, 24, "Draw")
ButtonGadget(4, 900, 50, 48, 24, "Clear")
BindGadgetEvent(3, @DrawSomething())
BindGadgetEvent(4, @ClrSomething())
EndIf
Repeat
Event=WaitWindowEvent()
Until Event=#PB_Event_CloseWindow
It can't be larger than 32768 in either direction.
Be carefull at the upper end of canvas/image size.
The handle starts to be unreliable as indicator for a successful created canvas/image when it approches the maximum usable memory.