Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Software Prototyping using DBPro - WinAPI and DBPro Plugins problems - please help i'm loosing my mind

Author
Message
zero32
7
Years of Service
User Offline
Joined: 28th Jul 2016
Location:
Posted: 2nd Aug 2016 11:17
Hello, thank you for reading.

i've written a bunch of code that allows me to have a moveable/resizeable window that is quick and smooth and without loosing display quality/having to change the display mode.
the window is painted using dbpro 2d commands. the display mode is set to the desktop width/height.

for the first test, i was using WinAPI transparency. my problem with this is that i can only define a rectangular region, so i can only have one "main" window and every other window must be inside of the main window. i don't want that.

next i've tested out the winskin plugin made by Scilynt. the idea is to create a screenshot, clear the skin, move the window on top of the screenshot and then get the new window position, width and height to create a new skin. the problem is, dbpro saves the image as a 32bit bitmap. the plugin somehow can't handle that.
i made an attempt to write my own save image function that writes a 24bit bitmap.
but a bitmap is flipped vertically. using the image kit plugin made by Sven B i flipped the image and then made a memblock from the flipped image, but the output gets screwed up...
also, my function is slow as f*

here is my code: (feel free to use in your own projects, but i do not comment my code...)

first test using winAPI:


saveBMP custom function,
you may need the WinSkin and ImageKit plugins:


zero32
7
Years of Service
User Offline
Joined: 28th Jul 2016
Location:
Posted: 3rd Aug 2016 13:58 Edited at: 3rd Aug 2016 14:49
ok, problem kinda solved.

i don't know why i used images in the first place (maybe just me being lazy) but i made some functions that will create a new 24bit bitmap without compression. you can draw dots or boxes onto the bitmap before saving them as a file.
the functions are quick enough for my project, so i guess you can close this thread

here are the functions, may they be useful to some of you:



EDIT: messed up the saveBMP function. works now....

Login to post a reply

Server time is: 2024-04-25 09:24:02
Your offset time is: 2024-04-25 09:24:02