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.

Newcomers DBPro Corner / Bitmap Commands

Author
Message
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 9th Feb 2004 01:04
I am not sure whether this should go here or under the 2d section but because it is a pretty basic question I put it here. Are there any commands for rotating a bitmap and resizing a bitmap? I am trying to create a really basic image editor and I wanted to include rotate and resize.
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 9th Feb 2004 02:17
I also just came up with another question I am wondering if anyone could answer. I have the basic code for the image editor but the set gamma command makes the image flicker alot and it doesn't work the way I want it to. (you can see that if you run the code included) I am wondering if anyone can help me get the set gamma to work without ficker and answer my first question.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Feb 2004 14:15
Ok, your first question - rotating/resizing a bitmap.

You cannot directly stretch or resize a bitmap. What you can do for stretching is to use the COPY BITMAP command to resize as you copy to a new bitmap.

The only way to rotate a bitmap in standard DBPro code (assuming that you are using 'Pro) is to grab the bitmap into an image, make a sprite of the image, rotate the sprite and then paste the sprite to your new bitmap.

If you are using DB Classic, then I believe that there is a ROTATE SPRITE command, but it only works in 90 degree steps.

I haven't got a PC here with DBC or DBPro on it, so I can't answer your second question yet, but you do know that you need fullscreen-exclusive mode to use fullscreen gamma don't you?

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 10th Feb 2004 00:41
What is the full screen exclusive mode?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Feb 2004 01:26
It's where DBC or DBPro take over the display completely rather than running in a window.

DBC does this by default, but you need to set it for DBPro - Ensure that the editor is in project mode and click the Settings button. You'll find the setting in the Display Settings box.

You can also do this by using the SET WINDOW OFF command in your code.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 10th Feb 2004 22:27
I am using DarkEDIT does that do it automatically? And if it does why does the screen still flicker if it is in full screen exclusive mode?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Feb 2004 23:58
Ah, you are using DBC then. I get a rock-solid display whenever I try your code - I can't think why your setup is having a problem.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 11th Feb 2004 22:42
I am not sure what is happening but when I use the exact code I posted the image flickers and the gamma doesn't work
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 11th Feb 2004 22:45
I take that back, the image still flickers but the gamma works.
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 11th Feb 2004 22:59
Sorry for the posts that keep coming and coming but I always think of something else. This time I think it is the last question I have. I still have the problem of the flickering though that is not my quetion. I have updated the code a bit and included SAVE BITMAP, but when I save it, it saves everything except for the gamma. Why is this? Updated code is included.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Feb 2004 00:48
It's because the gamma settings do not directly affect the bitmap itself. They just alter the way that the bitmap is displayed through your monitor.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 12th Feb 2004 03:16
so that is why the whole screen is affected by the gamma and not just the bitmap that I am editing, is there a way to make it just affect one section of the screen?
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 12th Feb 2004 10:14
nope, you have to change the bitmap itself. I don't use DBC but you should look into the MEMBLOCK commands... with a little coding you can do all sorts of image-effects.

if you can learn how to use memblocks, I can give you a function that will rotate an image memblock.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB
MaTt0344
20
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 14th Feb 2004 02:28
Here is some more code from another updated version of the program. I added in resizing but It doesn't work. (you can try for yourself) I know I am asking lots of questions but I am new to this and i am wondering if anyone could tell me what is wrong with this code.

Login to post a reply

Server time is: 2024-11-26 03:39:56
Your offset time is: 2024-11-26 03:39:56