Click to See Complete Forum and Search --> : Off Screen Image processing
shpigi
Jan 29th, 2001, 09:43 AM
I made an Active X control the uses 4 Picture objects to store bitmaps.
I want to make changes to these bitmaps when the user of the control changes a color parameter of the control.
How can I manipulate the data in the picture objects (without using on screen controls)?
In other words, I need to read and write to a Picture object.
Thanks..
YoungBuck
Jan 29th, 2001, 11:03 AM
You need to load the images into an Offscreen DC and manipulate them in the background here are some API calls you should look into....
Declare Function CreateCompatibleBitmap Lib "gdi32" Alias "CreateCompatibleBitmap" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Declare Function CreateCompatibleDC Lib "gdi32" Alias "CreateCompatibleDC" (ByVal hdc As Long) As Long
Declare Function SelectObject Lib "gdi32" Alias "SelectObject" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function DeleteObject Lib "gdi32" Alias "DeleteObject" (ByVal hObject As Long) As Long
Declare Function DeleteDC Lib "gdi32" Alias "DeleteDC" (ByVal hdc As Long) As Long
Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
If you want some good tutorials check out Fox's website, I think he has some good tutorials never read them but he seems to know what he is doing, GOOD LUCK!
shpigi
Jan 30th, 2001, 03:00 AM
Hey, Thanks a lot !
Read up on those API calls and managed to do it.
Also, had a look in Fox's Website. He had a demo on just this subject (called OffScreenDC).
Couldn't get better help :)
Shpigi.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.